Skip to content
Prev 259107 / 398502 Next

Insert values to histogram

On 05/05/2011 09:50 PM, matibie wrote:
Hi Matias,
You are probably using the "hist" function in the graphics package. If 
so, that function returns a list containing components named "counts" 
(for frequency histograms) and "density" (for density histograms). So if 
you collect that list:

histinfo<-hist(...)
histinfo$counts

you will see the heights of the bars. As Greg has noted, many people do 
not agree with adding the counts to the plot, but if you want to do it, 
there are your numbers.

Jim