[R] differencing a time series

From: oliver wee <islandboy1982_at_yahoo.com>
Date: Mon 13 Feb 2006 - 03:35:06 EST


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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Feb 13 03:43:49 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:27 EST