Skip to content

how to get vector of data from line ?

4 messages · Greg Snow, David Winsemius, madr

#
There are a few different options depending on what you are trying to do.

If you just need some data pairs (for plotting for example), then the return from density has a vector of x's and a vector of y's, just use those.

If you have specific x values that you need the height at and they follow a regular pattern, then you can modify the from, to, and n parameters to generate your x values, then they are in the return value.

You can approximate the values by passing the x and y from the return of density to the functions approx or approxfun.

You can estimate the density in a different way using the logspline package, it provides functions to give you the height of the curve at specified values.

You can just add the kernels together at your specified x values instead of using density (search the archives, I think Prof. Ripley recently posted a function to do this or similar).
#
On Dec 7, 2010, at 1:27 PM, madr wrote:

            
Learn to search:

http://finzi.psych.upenn.edu/Rhelp10/2010-September/253910.html