Sorry, I have some troubles with the graph device. How can I draw a function over a histogram? Thank''s so much. [[alternative HTML version deleted]]
Daniela Garavaglia wrote:> Sorry, I have some troubles with the graph device. > > How can I draw a function over a histogram? > > Thank's so much. >Daniela, What function? Here is one example using density() and using dnorm() x <- rnorm(1000,2,2) hist(x,prob=TRUE) lines(density(x,na.rm=TRUE),col="red") library(MASS) y <- fitdistr(x,"normal") curve(dnorm(x,mean=y$estimate[1],sd=y$estimate[2]),add=TRUE) HTH R.> [[alternative HTML version deleted]] <--- What about this?? > >