Re: [R] Date Math

2012-10-15 Thread Joshua Ulrich
Hi Noah, On Sun, Oct 14, 2012 at 12:14 PM, Noah Silverman noahsilver...@ucla.edu wrote: Hello, I have a time series object (xts) that I iterate over in a loop. Works fine. My challenge is that I want to be able to reference other entries in the series by math. i.e. For today's

Re: [R] Date Math

2012-10-15 Thread Paul Gilbert
On 12-10-15 06:00 AM, r-help-requ...@r-project.org wrote: Jeff, My understanding is that the lag command will lag an entire time series. That isn't what I'm looking for. I just want, for example, today, and 5 entries back. for exmple: iter - '2011-05-18' observations[iter] # works

[R] Date Math

2012-10-14 Thread Noah Silverman
Hello, I have a time series object (xts) that I iterate over in a loop. Works fine. My challenge is that I want to be able to reference other entries in the series by math. i.e. For today's observation, what were the last 5 observations? If indexed numerically, it is trivial, but I can

Re: [R] Date Math

2012-10-14 Thread Jeff Newmiller
There are a few ways. The xts package has a lag function. So does zoo. Pay careful attention to the conventions used for specifying relative time in these various packages. You can also infill your missing data to create a regularly-spaced time series. There is no shortage of web

Re: [R] Date Math

2012-10-14 Thread Noah Silverman
Jeff, My understanding is that the lag command will lag an entire time series. That isn't what I'm looking for. I just want, for example, today, and 5 entries back. for exmple: iter - '2011-05-18' observations[iter] # works fine, returns the row at that date. index(observations[iter[)

Re: [R] Date Math

2012-10-14 Thread Jeff Newmiller
?embed --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#..

Re: [R] Date Math

2012-10-14 Thread Noah Silverman
Jeff, My understanding is that the lag command will lag an entire time series. That isn't what I'm looking for. I just want, for example, today, and 5 entries back. for exmple: iter - '2011-05-18' observations[iter] # works fine, returns the row at that date. index(observations[iter[)