[R] Another newbie question: curve of normal distribution

About this list Date view Thread view Subject view Author view Attachment view

From: Matej Cepl (matej@ceplovi.cz)
Date: Tue 15 Oct 2002 - 07:20:47 EST


Message-id: <20021014212046.GA6464@komensky.surfbest.net>



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@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.



About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jun 2004 - 09:31:24 EST