[R] density() with from, to or cut and comparrison of density()

Greg Snow Greg.Snow at intermountainmail.org
Wed Aug 30 18:08:07 CEST 2006

You may want to look at the logspline package, it uses a different
technique than density does, but it estimates densities and allows you
to tell the routine that there is a minimum value and that the density
does not extend beyond there.

Hope this helps, 

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Rainer M Krug
Sent: Wednesday, August 30, 2006 4:27 AM
To: R help list
Subject: [R] density() with from, to or cut and comparrison of density()


the function density() does normally integrate to one - I've checked it
and it works and I also read the previous threads.
But I realised that it does not integrate to one if I use from, to or

My scenario: I simulated densities of a plants originating from an sseed
source at distance zero. Therefore the density of the plants will be
highest close to zero. Is there anything I can do to have this pattern?
If I use 'from' or 'cut', the resulting densities do not integrate to
one which I need as I want to compare different density curves.

Ny second question is concerning the bandwidth. An I correct in saying
that if I want to compare different density estimates that the bandwidth
should be the same for all of them?

Thanks in advance for your help,


Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT)

Department of Conservation Ecology and Entomology University of
Stellenbosch Matieland 7602 South Africa

Tel:		+27 - (0)72 808 2975 (w)
Fax:		+27 - (0)21 808 3304
Cell:		+27 - (0)83 9479 042

email:	RKrug at sun.ac.za
      	Rainer at krugs.de

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list