################################################### ### chunk number 1: readin ################################################### cars <- read.csv("cars.csv", header=T) cars[1:5,] ################################################### ### chunk number 2: plotcommand eval=FALSE ################################################### ## plot(cars$weight, cars$gpm, xlab="Weight", ylab="GPM", main="Gallons per Mile vs. Weight") ################################################### ### chunk number 3: carplot ################################################### plot(cars$weight, cars$gpm, xlab="Weight", ylab="GPM", main="Gallons per Mile vs. Weight") ################################################### ### chunk number 4: carmodel ################################################### cars.mod <- lm(gpm~weight, data=cars) cars.mod ################################################### ### chunk number 5: carline eval=FALSE ################################################### ## plot(cars$weight, cars$gpm, xlab="Weight", ylab="GPM", main="Gallons per Mile vs. Weight") ## abline(cars.mod) ################################################### ### chunk number 6: carlineplot ################################################### plot(cars$weight, cars$gpm, xlab="Weight", ylab="GPM", main="Gallons per Mile vs. Weight") abline(cars.mod) ################################################### ### chunk number 7: eggdata ################################################### eggs <- read.table("eggs.dat", header=T) eggs[11:16,] ################################################### ### chunk number 8: eggfactor ################################################### attributes(eggs$species) ################################################### ### chunk number 9: eggplotcommand eval=FALSE ################################################### ## plot(length~species, data=eggs, horizontal=T) ################################################### ### chunk number 10: eggplot ################################################### plot(length~species, data=eggs, horizontal=T) ################################################### ### chunk number 11: eggtest ################################################### pairwise.t.test(eggs$length, eggs$species)