Skip to content

Instantly share code, notes, and snippets.

@retospect
Created May 15, 2011 00:18
Show Gist options
  • Save retospect/972775 to your computer and use it in GitHub Desktop.
Save retospect/972775 to your computer and use it in GitHub Desktop.
Math 10: Graphing pinky length with R
# 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