[R] Another newbie question: curve of normal distribution

Matej Cepl matej at ceplovi.cz
Mon Oct 14 23:20:47 CEST 2002


I would like to get a curve of normal distrubtion over the
histogram. Something like the following (which obviously doesn't
work; see attached example).

	maluj <- function() {

	vrhy=read.csv("pennies.csv",head=TRUE)

	hf=table(vrhy$HEADS)
	postscript("heads.eps",onefile=FALSE,width=4.134,height=3.445,pointsize=12)
	plot(hf,main="Frequency distribution of heads",xlab="Throws",
		ylab="Frequency")
	lines(rnorm(length(hf),mean=mean(hf),sd=sd(hf)))
	dev.off(2)

	}

Any help, please?

Thanks

	Matej

-- 
Matej Cepl, matej at ceplovi.cz, PGP ID# D96484AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
understand, v.:
    To reach a point, in your investigation of some subject,
    at which you cease to examine what is really present, and
    operate on the basis of your own internal model instead.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: heads.eps
Type: application/postscript
Size: 5242 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20021014/b203f123/heads.eps


More information about the R-help mailing list