[R] density plot & probabilities

gregor rolshausen gregor.rolshausen at biologie.uni-freiburg.de
Sun Feb 1 15:49:07 CET 2009

hello !
I have question concerning *kernel density plots*:

how to plot <density vs. the probability> of a vector, when that vector 
is very short (5-10 values)?
I tried:

 > plot(density(x))


 > hist(x,probability=T,border="white")
 > lines(density(x))

for small length of vectors, the ylab is not 0<ylab<1 but fro example 
from 0 to 3. thats confusing for a density... why is that?

thanks for your time.

More information about the R-help mailing list