我希望您能在R项目中绘制一个累积直方图,其中Y轴报告的是百分比而不是频率。请注意保留HTML标记。
感谢您的帮助。
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()
感谢您的帮助。
hist(data, freq=FALSE)
中设置freq=FALSE
,以获取概率“百分比”,而不是频率。 - Jilber Urbina