# NOT RUN {
data(Cavendish)
summary(Cavendish)
boxplot(Cavendish, ylab='Density', xlab='Data set')
abline(h=5.517, col="red", lwd=2)
# trimmed means
sapply(Cavendish, mean, trim=.1, na.rm=TRUE)
# express in terms of G
G <- function(D, g=9.806, R=6371) 3*g / (4 * pi * R * D)
boxplot(10^5 * G(Cavendish), ylab='~ Gravitational constant (G)', xlab='Data set')
abline(h=10^5 * G(5.517), col="red", lwd=2)
# }
Run the code above in your browser using DataLab