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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -