[R] difference between two density plots
murdoch at stats.uwo.ca
Thu Apr 6 20:01:07 CEST 2006
On 4/6/2006 1:34 PM, Philipp H. Mohr wrote:
> I have two densities which I plot with:
> Both data sets are 2D and have the same scale.
> Is there a way of plotting the difference between the two density plots ?
?sm.density describes the value returned by those function calls, which
includes "the values of the density estimate at the evaluation points".
The evaluation points may be different between the two datasets, but
you could use approxfun to generate functions doing linear interpolation
for each of them, and then evaluate the density difference whereever you
More information about the R-help