### density plots for meltpt of beeswax rm(list=ls()) ### Suess's Way ### #bees = matrix(scan("D:\\stat6502\\density\\beeswax.dat"),ncol=2,byrow=T) #bees ### My Way, read the data directly from the website ### bees = read.table("http://www.sci.csueastbay.edu/~esuess/Statistics_65016502/Handouts/2013/6501/ECDF/BEESWAX.DAT", header=FALSE, quote="") meltpt = bees[,1] phydcarb = bees[,2] par(mfrow=c(2,1)) hist(meltpt, col="mistyrose",main="Histogram of Melting Points of Beeswax", xlab=expression(paste("Melting Point (",degree,"C)"))) # density plot for meltpt # n is the number of equally spaced points at which to estimate the density # window is the number of equally spaced points at which to estimate the density plot(density(meltpt, n=50, window="g"),type="b", main="Density of Melting Points of Beewax", xlab=expression(paste("Melting Point (",degree,"C)")), ylab="density")