################################################### ### chunk number 1: ################################################### options("width"=70) ################################################### ### chunk number 2: ################################################### load("students.RData") attach(students) plot(I.am.) ################################################### ### chunk number 3: ################################################### I.am.2 = as.character(I.am.) I.am.2 = factor(I.am.2, levels = c("small", "intermediate", "tall")) plot(I.am.2) ################################################### ### chunk number 4: ################################################### pie(table(I.am.2)) ################################################### ### chunk number 5: ################################################### pie(table(Country.of.birth)) ################################################### ### chunk number 6: ################################################### hist(Length) ################################################### ### chunk number 7: ################################################### hist(Length[Length < 210]) abline(v = mean(Length[Length < 210]), col = 'red') ################################################### ### chunk number 8: ################################################### hist(Length[Length < 210], freq = FALSE) ################################################### ### chunk number 9: ################################################### n = length(Length) qqplot(Length, (1:n)/(n+1), type = 'l') ################################################### ### chunk number 10: ################################################### opar = par() ################################################### ### chunk number 11: ################################################### Unif.200 = runif(200) n = length(Unif.200) par(mfrow=c(1,2)) hist(Unif.200, 5) qqplot(Unif.200, (1:200)/(200+1), type = 'l') ################################################### ### chunk number 12: ################################################### Norm.200 = rnorm(200) par(mfrow=c(1,2)) hist(Norm.200, 5) qqnorm(Norm.200) qqline(Norm.200) ################################################### ### chunk number 13: ################################################### par(mfrow=c(1,2)) qqnorm(Length) qqline(Length) qqnorm(Length[Length < 210]) qqline(Length[Length < 210]) ################################################### ### chunk number 14: ################################################### Weight~Length class(Weight~Length) ################################################### ### chunk number 15: eval=FALSE ################################################### ## plot(x, y) ## plot(y ~ x) ################################################### ### chunk number 16: ################################################### methods(plot) ################################################### ### chunk number 17: ################################################### par(mfrow=c(1,2)) plot(I.am.2~Gender) plot(Gender~I.am.2) ################################################### ### chunk number 18: ################################################### plot(I.am.2 ~ Length) ################################################### ### chunk number 19: ################################################### plot(Length ~ I.am.2) ################################################### ### chunk number 20: ################################################### par(mfrow=c(1,2)) plot(Weight ~ Length) plot(Weight ~ Length, students[Length < 200, ]) ################################################### ### chunk number 21: ################################################### library(sp) load("katha/.RData") plot(wetter.ll, axes = TRUE, col = 'red') ################################################### ### chunk number 22: ################################################### library(sp) plot(NRW) plot(wetter.ll, add=TRUE, col = 'red') ################################################### ### chunk number 23: eval=FALSE ################################################### ## library(sp) ## spplot(wetter.ll, "MESSWERT") ################################################### ### chunk number 24: ################################################### library(sp) print(spplot(wetter.ll, "MESSWERT", col.regions=bpy.colors(),cuts=c(0,1,2,4,8,12), sp.layout = list("sp.polygons", NRW), key.space = "right")) ################################################### ### chunk number 25: eval=FALSE ################################################### ## library(lattice) ## load("pm10.RData") ## xyplot(values~time|Station, pm10tso, type='l', layout=c(1,4), xlab="2006/7", ylab="PM10", ylim=c(0,200)) ################################################### ### chunk number 26: ################################################### library(lattice) load("pm10.RData") print(xyplot(values~time|Station, pm10tso, type='l', layout=c(1,4), xlab="2006/7", ylab="PM10", ylim=c(0,200))) ################################################### ### chunk number 27: ################################################### plot(students[c("Length","Weight","Age")], col=as.numeric(students$Gender)) #$ ################################################### ### chunk number 28: eval=FALSE ################################################### ## library(lattice) ## bwplot(Weight~I.am.2|Gender, students) ################################################### ### chunk number 29: ################################################### library(lattice) print(bwplot(Weight~I.am.2|Gender, students)) ################################################### ### chunk number 30: eval=FALSE ################################################### ## library(lattice) ## check = Length < 220 ## xyplot(Weight~Length|Gender, students[check,]) ################################################### ### chunk number 31: ################################################### library(lattice) check = Length < 220 print(xyplot(Weight~Length|Gender, students[check,])) ################################################### ### chunk number 32: eval=FALSE ################################################### ## library(lattice) ## xyplot(Weight~Length|Gender+I.am.2, students[check,]) ################################################### ### chunk number 33: ################################################### library(lattice) print(xyplot(Weight~Length|Gender+I.am.2, students[check,]))