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 fin

Re: [R] Date Math

2012-10-15 Thread Joshua Ulrich
Hi Noah, On Sun, Oct 14, 2012 at 12:14 PM, Noah Silverman 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 observation, what were t

Re: [R] Date Math

2012-10-14 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Noah Silverman > Sent: Sunday, October 14, 2012 7:14 PM > To: R-help@r-project.org > Subject: [R] Date Math > > Hello, > > > I have

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:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer

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
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 informa

[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 fi