本文介绍了如何在直方图上方绘制密度估计?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
x
是无NA的数值向量.
x
is a NAs free numeric vector.
我跑步:
> hist(x,density(x), prob=TRUE)
Error Message I get:
Error in rank(x, ties.method = "min", na.last = "keep") :
unimplemented type 'list' in 'greater'
建议在调用hist时将prob设置为TRUE.如果您也能解释这一点,那将是很棒的.谢谢.
It was suggested that I set prob =TRUE when calling hist. If you can explain that as well, it will be great. Thank you.
推荐答案
您需要分别调用hist
和density
.像这样:
You need to call hist
and density
separately. Something like this:
hist(x, prob=TRUE)
lines(density(x))
这篇关于如何在直方图上方绘制密度估计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!