[R] Must be easy, but haven't found the function (numerical integration)

Paul Smith phhs80 at gmail.com
Mon Sep 17 15:24:53 CEST 2007


On 9/17/07, Ptit_Bleu <ptit_bleu at yahoo.fr> wrote:
> I have a data frame of 2 columns with the following types :
> data$day char
> data$value num
>
> And I plot my data with :
> plot(strptime(donnees$day,format="%Y-%m-%d %H:%M:%S"),donnees$value,
> type="l")
>
> And I'd just like to get the numerical value of the integration of this
> graph.
> I looked at ?integrate but, as far as I understood (that is, not very much,
> due to my poor english), it seems that it doesn't work with values in data
> frame.
>
> Could you please help me to do this ?

I admit that others may find better solutions, but a possible solution
could be summing the areas of the trapezoids over the sequence of
them. It would be easy to program a function to do that, I guess

Paul



More information about the R-help mailing list