[R] can I calculate density for only non-negative value?

David Winsemius dwinsemius at comcast.net
Tue Aug 20 07:24:06 CEST 2013


On Aug 19, 2013, at 7:35 PM, Gallon Li wrote:

> x=rchisq(100,1)
> density(x)
> 
> the density plot will give density for negative part also. of course I can
> truncate the plot to only view the non-negative part.
> 
> I wonder if there is a program to compute density for a user-specified
> range, in this case, only [0, infinity).

This has been asked and answered several times on this list.

-- 

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list