Skip to content
Prev 25278 / 398502 Next

evaluating density objects

On Thu, 14 Nov 2002, Hinnerk Boriss wrote:

            
?density tells you

Value:

     If `give.Rkern' is true, the number R(K), otherwise an object with
     class `"density"' whose underlying structure is a list containing
     the following components.

       x: the `n' coordinates of the points where the density is
          estimated.

       y: the estimated density values.

...

so you could for example do

dens <- density(...)
write.table(data.frame(x=dens$x, y=dens$y), "somefile")

I have no idea why anyone would want to plot in gnuplot rather than in R,
and hence don't know what formats gnuplot accepts.