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
Post a Comment