# boxplots mydataframe <- read.delim("http://www.robin-beaumont.co.uk/virtualclassroom/book2data/pain_medication.dat", header=TRUE) names(mydataframe) # local copy mydataframe <- read.delim("D:\\web_sites_mine\\HIcourseweb new\\book2data\\pain_medication.dat", header=TRUE) names(mydataframe) str(mydataframe) # R Commander auto generated - uses the Rcmdr function Boxplot (in the car package) # instead of the generic boxplot() library(car) Boxplot(time~dosage, data=mydataframe, id.method="y") # now using the generic boxplot() newdata <- split(mydataframe$time, mydataframe$dosage) boxplot(newdata, col = "lavender", notch = TRUE, varwidth = TRUE) or boxplot(mydataframe$time ~ mydataframe$dosage, col = "lavender", notch = TRUE, varwidth = TRUE) # use the medlwd option to increase the width of the median line boxplot(newdata, col = "grey90", medlwd=5) boxplot(mydataframe$time ~ mydataframe$dosage, col = "lavender", notch = TRUE, varwidth = TRUE, medlwd=10) # R Commander auto generated Boxplot(values~ind, data=mydataframe, id.method="y") Boxplot(values~ind, data=mydataframe, id.method="n") Boxplot(values~ind, data=mydataframe, id.method="identify")