[R] hist densities

From: Luke Spadavecchia <l.spadavecchia_at_googlemail.com>
Date: Fri, 21 Mar 2008 14:36:45 +0000


Hi there,

I was wondering why

x<-rnorm(n=5000,mean=1.5,sd=0.25)
h<-hist(x)
sum(h$density)

[1] 10

I thought the integral of the histogram should be one? These seems strange to me, or am I being silly...

Regards Luke Spadavecchia

PS. I'm using R 2.5.1 on Mac OSX



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 21 Mar 2008 - 14:51:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 21 Mar 2008 - 16:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive