# # Epage 37 # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- library(DAAG) Manitoba.lakes = data.frame( elevation=c(217, 254, 248, 254, 253, 227, 178, 207, 217), area=c(24387, 5374, 4624, 2247, 1353, 1223, 1151, 755, 657) ) row.names(Manitoba.lakes) = c("Winnipeg","Winnipegosis","Manitoba","SouthernIndian","Cedar","Island","Gods","Cross","Playgreen") print( head(Manitoba.lakes,3) ) # Part (a) (using the code as requested): # #postscript("../../WriteUp/Graphics/Chapter1/prob_6_plot.eps", onefile=FALSE, horizontal=FALSE) attach(Manitoba.lakes) plot(log2(area) ~ elevation, pch=16, xlim=c(170,280)) text(log2(area) ~ elevation, labels=row.names(Manitoba.lakes), pos=4) text(log2(area) ~ elevation, labels=area, pos=2) title("Manitoba's largest lakes") detach(Manitoba.lakes) #dev.off() # Part (b) (do I just add log="y" only?): # #postscript("../../WriteUp/Graphics/Chapter1/prob_6_plot_logy.eps", onefile=FALSE, horizontal=FALSE) attach(Manitoba.lakes) plot(area ~ elevation, pch=16, xlim=c(170,280), log="y") text(area ~ elevation, labels=row.names(Manitoba.lakes), pos=4) text(area ~ elevation, labels=area, pos=2) title("Manitoba's largest lakes") detach(Manitoba.lakes) #dev.off()