pdf("ex0108.pdf") # Read in data from ASCII formatted (Fixed With File) ex0108dat <- read.fwf("http://www.stat.ufl.edu/~winner/data/biostat/ex0108.dat", width=c(8,8,8,7), col.names=c("subject","drugid","theophclrnc","drugname")) # Create a dataset (frame) from input data ex0108 <- data.frame(ex0108dat) # Attach the dataset for analysis attach(ex0108) # Plot Theophylline Clearance versus Interacting Drug (joining points by subject) interaction.plot(drugname, subject, theophclrnc) # Plot Theophylline Clearance versus Subject (joning points by drug) interaction.plot(subject, drugname, theophclrnc) dev.off()