[R] Fitting a curve to data

Carl Witthoft carl at witthoft.com
Tue Jul 1 23:22:32 CEST 2008


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.



More information about the R-help mailing list