[R] evaluating density objects

Hinnerk Boriss boriss at izbi.uni-leipzig.de
Fri Nov 15 16:56:56 CET 2002

Thanks for all the suggestions!

> 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.

The point is that I want to plot many densities in one graph. I can do
that with R using par(new=T), but I cannot print those graphs. 

Thus, I wonder if I could also apply (lapply) density(...) to a vector
of x-values, to get a my different density functions evaluated all at
the same x. Then, I should be able to write a file that looks like:

X dens1(X) dens2(X) ...

Can anyone help?



r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list