########## ## # Reading the data into R: my.datafile <- tempfile() cat(file=my.datafile, " 1 CONTROL .58620 1.1 1 CONTROL 1.26187 .87 1 CONTROL .76769 1.003 1 CONTROL .6367 1.114 1 CONTROL .57445 1.3631 1 WATER .39538 2.403 1 WATER .65846 1.649 1 WATER .52720 1.678 1 WATER .38697 2.547 1 WATER .67373 1.186 1 GAS .44799 2.485 1 GAS .43299 3.175 1 GAS .62108 2.057 1 GAS .37185 2.491 1 GAS .80185 1.397 2 CONTROL .64045 1.29 2 CONTROL .35201 2.024 2 CONTROL .35333 1.406 2 CONTROL .55141 1.391 2 CONTROL .80285 .772 2 WATER .37687 1.369 2 WATER .94273 .565 2 WATER .83863 .711 2 WATER .59236 .903 2 WATER .62517 1.281 2 GAS .66416 1.715 2 GAS 1.02955 1.285 2 GAS .4791 1.693 2 GAS 1.17344 1.202 2 GAS .28149 2.026 ", sep=" ") options(scipen=999) # suppressing scientific notation oysterdata <- read.table(my.datafile, header=FALSE, col.names=c("location", "regime", "weight", "oxygen")) ## NOTE: "location" is what the book calls "replication" -- this is the BLOCKING factor. ## "regime" is the treatment factor (there are three types of regime). ## Ignore the "weight" variable -- it is not used. ## "oxygen" is the response here. attach(oysterdata) location <- factor(location) regime <- factor(regime) # ####