the most basic function is integrate() {stats}. You just specify a function and the integration bounds. It only works for functions with 1 dependent variable. But since you are using time series that will probably work for you.
The help page should give you all the details you need: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/integrate.html
As others pointed out, there are many alternatives, but this one is simplest, i think.
Hi Prabhat, I realize this is a couple years old, but in case you or anyone else is still interested, the package Bolstad2 in R, written by James Curran uses Simpson's rule to calculate the AUC. The number of data points may be even or odd and the intervals along x-axis do not have to be evenly spaced. Check it out :