This is a reply to Luke Spadavecchia's question about hist densities.

 

If you want to construct a histogram where the bar heights are the
percentage of observations in the intervals you can use this code:

 

x<-rnorm(n=5000,mean=1.5,sd=0.25)

h<-hist(x)

h$density<-h$counts/sum(h$counts)

plot(h,freq=F,ylab="Percentage")

 

Sarah Hardy

[EMAIL PROTECTED]

 

 


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to