[R] differencing a time series

oliver wee islandboy1982 at yahoo.com
Sun Feb 12 17:35:06 CET 2006


Hello, I need some help in differencing a time series.

For example I have a data set with 100 data points. I
need to create a new dataset that consists of the
difference of two succeeding data points.

something akin to this formula in java:
for (int i = 0, i < 100, i++)
{
  newdataset[i] = olddataset[i] - olddataset[i-1]
}

any help is appreciated. Thanks




More information about the R-help mailing list