سؤال

Possible Duplicate:
Fitting a density curve to a histogram in R

x is a NAs free numeric vector.

I run:

> 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'

It was suggested that I set prob =TRUE when calling hist. If you can explain that as well, it will be great. Thank you.

هل كانت مفيدة؟

المحلول

You need to call hist and density separately. Something like this:

hist(x, prob=TRUE)
lines(density(x))
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top