histogram - Use hist() function in R to get percentages as opposed to raw frequencies -


how can 1 plot percentages opposed raw frequencies using hist() function in r?

simply using freq=false argument not give histogram percentages, normalizes histogram total area equals 1.
histogram of percentages of data set, x, do:

h = hist(x) h$density = h$counts/sum(h$counts)*100 plot(h,freq=false) 

basically doing creating histogram object, changing density property percentages, , re-plotting.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Python Tornado package error when running server -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -