And, oddly enough :-), integrate.xy does pretty much exactly what I suggested. Thanks for providing that reference

I would be interested in seeing how the original poster's data works out using integrate.xy as opposed to simply calculating x*y

By the way, since the original data were 'percent of total volume' over each hour of the day, how could the integral NOT be 100%?

Carl

Gabor Grothendieck wrote:

There is an integrate.xy in sfsmic.  Limitations discussed there.

On Tue, Jul 1, 2008 at 6:27 PM, stephen sefick <[EMAIL PROTECTED]> wrote:
I would like to know the answer to this question now that I know what we are
getting at.  integrate() looks like it is the right thing, but it has to use
a function-  I would like to know how to just integrate the area under a
curve with just an input of x and y coordinates.

Stephen

On Tue, Jul 1, 2008 at 5:22 PM, Carl Witthoft <[EMAIL PROTECTED]> wrote:

I think the previous answer (to use lm() ) is not necessarily the best
option.

Since what you want is the definite integral (area under the curve), you
can just use one of the existing definite integration tools (sorry, I don't
recall the names because I don't use them).

If you want to get a "smoothed" curve to remove errors in your data points,
 I'd recommend fitting a spline and integrating under that.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to