[R] Overlaying graphs

Paul Meagher paul at datavore.com
Wed Sep 3 18:18:42 CEST 2003

I am wanting to construct a probability distribution for height and then,
hopefully, visually and analytically demonstrate that it is normally

These are the commands I have developed so far:

fat   <- read.table("fat.dat", header=TRUE)
mu    <- mean(fat$height)
sdev  <- sd(fat$height)
hist(fat$height, br=20, freq=FALSE, xlab="Male Height in Inches")
curve(dnorm(x, mu, sdev), from=64, to=78)

I do not know how to overlay the curve graphic on top of hist graphic.

I am hoping to show visually that the normal curve overlays the obtained
probability distribution when plotted on the same graph.  Unfortunately, I
an not sure how to overlay them. Can anyone point me in the right direction
or show me the code.

The data set is here:


Paul Meagher

More information about the R-help mailing list