[R] Scriptable Integration

Hasan Diwan hasan.diwan at gmail.com
Sat Feb 11 03:50:53 CET 2012


Michael,
On 10 February 2012 18:11, R. Michael Weylandt
<michael.weylandt at gmail.com> wrote:
> I'm not quite sure what you mean, but perhaps this will help:
> spf <- splinefun(mydata$V2)
> splInt <- function(low, up) integrate(spf, low, up)$value

Sort of, I'm looking to get the nth order integral, where the only
thing I know about n is that it is greater than 1, but in practise
will be under 4. Something like:
spf <- rep(splinefun(myData$V2, times=(n-1))
splInt <- integrate(spf, min(myData$V2), max(myData$V3))

However, I can't seem to figure out how to get splinefun to evaluate
itself. Hope that's clearer and thanks for the help!
-- 
Sent from my mobile device
Envoyait de mon portable



More information about the R-help mailing list