我希望在R项目绘制一个累积的柱状图,其中在Y轴报道的百分比,而不是频率与Y轴百分比累积的柱状图
x <- c(rnorm(100), rnorm(50, mean=2,sd=.5))
h <- hist(x, plot=FALSE, breaks=20)
h$counts <- cumsum(h$counts)
h$density <- cumsum(h$density)
plot(h, freq=TRUE, main="(Cumulative) histogram of x", col="white", border="black")
box()
感谢您的帮助
设置'频率= FALSE'在'HIST(数据频率= FALSE)'你拿概率“百分比”,而不是频率 –
的是它可以添加/更改与行的吧? –