简单地使用freq=FALSE参数不会给出带有百分比的直方图,它会标准化直方图,因此总面积等于 1。
要获得某些数据集的百分比直方图,例如 x,请执行以下操作:
h = hist(x) # or hist(x,plot=FALSE) to avoid the plot of the histogram
h$density = h$counts/sum(h$counts)*100
plot(h,freq
简单地使用freq=FALSE参数不会给出带有百分比的直方图,它会标准化直方图,因此总面积等于 1。
要获得某些数据集的百分比直方图,例如 x,请执行以下操作:
h = hist(x) # or hist(x,plot=FALSE) to avoid the plot of the histogram
h$density = h$counts/sum(h$counts)*100
plot(h,freq