Created
May 15, 2011 00:18
-
-
Save retospect/972775 to your computer and use it in GitHub Desktop.
Math 10: Graphing pinky length with R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gnu R code to generate histogram for lab | |
length_of_pinky = c(6,5.5,5.5,6.5,5.5, 5,5.5,6.5,5.5,6, 5.5,6,5.5,5,6, 5,6.5,6,5.5,5, 5.5,7.5,6,5.5,5.5, 6,5.5,6,6.5,7) | |
hist(length_of_pinky, seq(4.75, 7.75, 0.5), prob=TRUE, main="Histogram of students pinky length [cm]", xlab="Length of pinky [cm]") | |
lines(density(length_of_pinky, bw=0.25), col="blue") | |
curve(dnorm(x,mean=mean(length_of_pinky), sd=sd(length_of_pinky)), add=TRUE, col="green") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment