seq(0, pi, length = 12)

[1] 0.0000000 0.2855993 0.5711987 0.8567980

[5] 1.1423973 1.4279967 1.7135960 1.9991953

[9] 2.2847947 2.5703940 2.8559933 3.1415927

> rep(c(0, 1, 2, 4, 9), times = 5)

[1] 0 1 2 4 9 0 1 2 4 9 0 1 2 4 9 0 1 2 4 9 0 1 2

[24] 4 9

> rep(c(0, 1, 2, 4, 9), each = 2)

[1] 0 0 1 1 2 2 4 4 9 9

>

> rep(c(0, 1, 2, 4, 9), each = 2, times = 5)

[1] 0 0 1 1 2 2 4 4 9 9 0 0 1 1 2 2 4 4 9 9 0 0 1

[24] 1 2 2 4 4 9 9 0 0 1 1 2 2 4 4 9 9 0 0 1 1 2 2

[47] 4 4 9 9

> x <- seq(0, 10, 0.1)

> y <- sin(x)

> plot(x, y)

>

> x <- seq(0, 10, pi)

> plot(x, y)

Error in xy.coords(x, y, xlabel, ylabel, log) :

'x' and 'y' lengths differ

> plot(x, y, type = "l")

Error in xy.coords(x, y, xlabel, ylabel, log) :

'x' and 'y' lengths differ

>

> x <- seq(0, 10, 0.1)

> y <- sin(x)

> plot(x, y)

> plot(x, y, type = "l")

> y1 <- cos(x)

> y1 <- cos(x)

> lines(x, y1, col = "red")

> x1 <- 1:10

> text(x1, sin(x1), x1, col = "green")

>

> plot(x, y, xlim = c(-10, 10), ylim = c(-2, 2),

+ xlab = "x-Values", ylab = "y-Values", main = "Example Graphics")

>

> par(mfrow = c(2, 2))

> x <- rnorm(100)

> plot(x)

>

> hist(x)

>

> qqnorm(x)

> qqline(x, col="red")

> hist(x, probability = TRUE)

> xx <- seq(-3, 3, 0.1)

> lines(xx, dnorm(xx, 0, 1),col = "red")

> par(mfrow=c(2,2))

> y <- runif(100)

> plot(y)

> hist(y)

> qqnorm(y)

> qqline(y, col="red")

> mean(y)

[1] 0.4681318

> var(y)

[1] 0.09231063

> min(y)

[1] 0.0009405699

> max(y)

[1] 0.9884459

> hist(y, probability=TRUE)

> yy <- seq(min(y), max(y), length = 50)

> lines(yy, dnorm(yy, mean(y), sd(y)), col = "red")

> shapiro.test(y)

Shapiro-Wilk normality test

data: y

W = 0.93333, p-value = 7.726e-05

>

> par(mfrow=c(1, 1))

> boxplot(x, y)

> boxplot(x, y,col = 101)

> boxplot(x, y,col = 101,size = n)

Error in boxplot.default(x, y, col = 101, size = n) :

object 'n' not found

> (library(foreign))

[1] "foreign" "stats" "graphics" "grDevices"

[5] "utils" "datasets" "methods" "base"

> (library(shapefiles))

Error in library(shapefiles) : there is no package called ‘shapefiles’

> attach(mydata)

Error in attach(mydata) : object 'mydata' not found

> group1 <- leng[klett == 0.25 & temp == 11]

Error: object 'leng' not found

> group2 <- leng[klett == 1 & temp == 11]

Error: object 'leng' not found

> group3 <- leng[klett == 16 & temp == 11]

Error: object 'leng' not found

> # ....

> boxplot(group1, group2, group3, names=c("0.25/11", "1/11", "16/11"))

Error in boxplot(group1, group2, group3, names = c("0.25/11", "1/11", :

object 'group1' not found

> detach(mydata)

Error in detach(mydata) : invalid 'name' argument

> plot(1:30, qt(0.975, 1:30), type="l",

+ ylab="Student´s t", xlab="d.f.", ylim=c(0,15))

> abline(h=qnorm(0.975), lty="dotted")

>

> hist(log(x), probability=TRUE)

Warning message:

In log(x) : NaNs produced

> xnew <- seq(log(min(x)), log(max(x)), length=100)

Error in seq.default(log(min(x)), log(max(x)), length = 100) :

'from' must be a finite number

In addition: Warning message:

In log(min(x)) : NaNs produced

> lines(xnew, dnorm(xnew, mean=mean(log(x)), sd=sd(log(x))), col="red")

Error in lines(xnew, dnorm(xnew, mean = mean(log(x)), sd = sd(log(x))), :

object 'xnew' not found

> x <- seq(0.01, 4, length=100)

> par(mfrow=c(2, 2))

> plot(x, dgamma(x, .5, .5), type="l")

> plot(x, dgamma(x, .8, .8), type="l")

> plot(x, dgamma(x, 2, 2), type="l")

> plot(x, dgamma(x, 10, 10), type="l")

>

> x1 <- rnorm(100, mean = 50, sd = 10) # normal distribution

> x2 <- runif(100, min = 30, max = 70) # uniform distribution

> x3 <- rlnorm(100, meanlog = 2, sdlog = 1) # lognormal distribution

> boxplot(x1, x2, x3,

+ names=c("Normal", "Uniform", "Lognormal"))

>

> x1 <- c(2, 3, 4, 5, 6)

> x2 <- c(3, 4, 7, 6, 8)

> t.test(x1, x2, var.equal=TRUE) # p=0.20

Two Sample t-test

data: x1 and x2

t = -1.372, df = 8, p-value = 0.2073

alternative hypothesis: true difference in means is not equal to 0

95 percent confidence interval:

-4.28924 1.08924

sample estimates:

mean of x mean of y

4.0 5.6