###################################################################### # Computer notes Biostatistics 140.776 # Homework 2 Johns Hopkins University ###################################################################### # Lines beginning with the symbol '#' are comments in R. All other # lines contain code. # # In R for Windows, you may wish to open this file from the menu bar # (File:Display file); you can then easily copy commands into the # command window. (Use the mouse to highlight one or more lines; then # right-click and select "Paste to console".) ###################################################################### ############################################### # 1 ############################################### x=sample(c("A","C","G","T"),10000,rep=T) ktuple=function(x,k=3){ if (length(x)==1) x=unlist(strsplit(x,"")) if (length(x)=120) text(wh,Ozone[wh]+5,paste(month.abb[Month][wh],Day[wh],sep=" ")) plot(Solar.R,Ozone,xlab="Solar radiation",ylab="Ozone concentration [ppb]") coplot(Ozone~Solar.R|Wind) coplot(Ozone~Solar.R|Temp) coplot(Ozone~Solar.R|Wind*Temp) library(lattice) wind=equal.count(Wind,number=6) temp=equal.count(Temp,number=6) trellis.device(col=F) xyplot(Ozone~Solar.R|wind) xyplot(Ozone~Solar.R|temp) xyplot(Ozone~Solar.R|wind*temp) ################## # End of hw2.R ##################