numbereggs <- c(27, 32, 39, 48, 59, 67, 71, 65, 73, 67, 78, 72, 81, 74, 83, 75, 84, 77, 83, 76, 82, 75, 78, 77, 75, 73, 71, 70, 68, 65) weight <- c(2.1, 2.3, 2.4, 2.5, 2.9, 3.1, 3.2, 3.3, 3.4, 3.4, 3.5, 3.5, 3.5, 3.6, 3.6, 3.6, 3.6, 3.7, 3.7, 3.7, 3.8, 3.9, 4.0, 4.3, 4.4, 4.7, 4.8, 4.9, 5.0, 5.1) plot(weight,numbereggs,xlab="Number of eggs",ylab="Weight",main="Grasshopper data") abline(lm(numbereggs ~ weight)) lines(lowess(weight,numbereggs)) cor(numbereggs,weight) # calculate the Pearson correlation coefficient rm(numbereggs,weight) # delete the objects when we are finished