Entdecken Sie eBooks
Kategorien
Entdecken Sie Hörbücher
Kategorien
Entdecken Sie Zeitschriften
Kategorien
Entdecken Sie Dokumente
Kategorien
#ttp&00"log1o*cupid1com0index1p#p0t#e'"iggest'li
es'in'online'dating0
#ttp&00de1+i*ipedia1org0+i*i0Anscom"e'(uartett
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
R
+++1r'pro4ect1org
9pen )ource
-:5 7i/en/
?@000 2ac*ages
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
>ools f3r R
R)tudio
Rcmdr
R f3r Eclipse
R*+ard
>inn'R
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
R =ommunity
#ttp&00stac*overflo+1com0Auestions0tagged0r
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
#ands on R
citation()
licence()
anscombe
help()
demo()
plot(1:10)
scan()
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
11 Beispiel
> x <- scan()
1: 1
2: 4
3: 9
4: 16
5: 25
6: 36
7: 49
8: 64
9: 81
10:
Read 9 items
> plot(x)
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
11 Beispiel
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
21 Beispiel
> x <- rnorm(100)
> y <- rt(100,df=3)
> par(mfrow=c(2,2))
> hist(x, col=2)
> qqnorm(x)
> qqplot(x, y)
> boxplot(x, col="green")
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
21 Beispiel
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
B1 Beispiel
> plot(rnorm(1000))
> dev.copy(svg, file="myfile.svg")
svg
3
> dev.off()
windows
2
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
B1 Beispiel
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
1 Beispiel
> site <- "http://random.org/integers/"
> query <-
"num=10&min=100&max=200&col=2&base=10&format=
plain&rnd=new"
> txt <- paste(site, query, sep="?")
> nums <- read.table(file=txt)
> nums
V1 V2
1 178 179
2 138 104
3 194 119
4 175 170
5 160 179
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
@1 Beispiel
> head(InsectSprays)
count spray
1 10 A
2 7 A
3 20 A
4 14 A
5 14 A
6 12 A
> boxplot(count ~ spray, data =
InsectSprays, col = "lightgray")
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
@1 Beispiel
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
@1 Beispiel
> str(InsectSprays)
'data.frame': 72 obs. of 2 variables:
$ count: num 10 7 20 14 14 12 10 23 17
20 ...
$ spray: Factor w/ 6 levels
"A","B","C","D",..: 1 1 1 1 1 1 1 1 1 1 ...
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
C1 Beispiel
> ?data
> data()
> data(AirPassengers)
> AP <- AirPassengers
> AP
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1949 112 118 132 129 121 135 148 148 136 119 104 118
1950 115 126 141 135 125 149 170 170 158 133 114 140
1951 145 150 178 163 172 178 199 199 184 162 146 166
1952 171 180 193 181 183 218 230 242 209 191 172 194
1953 196 196 236 235 229 243 264 272 237 211 180 201
1954 204 188 235 227 234 264 302 293 259 229 203 229
1955 242 233 267 269 270 315 364 347 312 274 237 278
1956 284 277 317 313 318 374 413 405 355 306 271 306
1957 315 301 356 348 355 422 465 467 404 347 305 336
1958 340 318 362 348 363 435 491 505 404 359 310 337
1959 360 342 406 396 420 472 548 559 463 407 362 405
1960 417 391 419 461 472 535 622 606 508 461 390 432
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
C1 Beispiel
> str(AirPassengers)
Time-Series [1:144] from 1949 to 1961: 112 118 132
129 121 135 148 148 136 119 ...
> class(AP)
[1] "ts"
> start(AP); end(AP); frequency(AP)
[1] 1949 1
[1] 1960 12
[1] 12
> plot(AP)
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
C1 Beispiel
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
C1 Beispiel
> layout(1:2)
> plot(aggregate(AP))
> boxplot(AP ~ cycle(AP))
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
C1 Beispiel
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
C1 Beispiel
> AP.hw <- HoltWinters(AP, seasonal="mult")
> plot(AP.hw)
>
> AP.predict <- predict(AP.hw, n.ahead=4*12)
> ts.plot(AP, AP.predict, lty=1:2)
>
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
C1 Beispiel
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
C1 Beispiel
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
D1 Beispiel
> head(mtcars)
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1
> pairs(mtcars, main = "mtcars data")
> str(mtcars)
'data.frame': 32 obs. of 11 variables:
$ mpg : num 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ...
$ cyl : num 6 6 4 6 8 6 8 4 4 6 ...
$ disp: num 160 160 108 258 360 ...
$ hp : num 110 110 93 110 175 105 245 62 95 123 ...
$ drat: num 3.9 3.9 3.85 3.08 3.15 2.76 3.21 3.69 3.92 3.92 ...
$ wt : num 2.62 2.88 2.32 3.21 3.44 ...
$ qsec: num 16.5 17 18.6 19.4 17 ...
$ vs : num 0 0 1 1 0 1 0 1 1 1 ...
$ am : num 1 1 1 0 0 0 0 0 0 0 ...
$ gear: num 4 4 4 3 3 3 3 4 4 4 ...
$ carb: num 4 4 1 1 2 1 4 2 2 4 ...
Rolf Andreas Just @Handgemenge Explorative Datenanalyse in R
D1 Beispiel