Skip to content
Prev 155802 / 398503 Next

Truncating dates (and other date-time manipulations)

On Thu, Sep 11, 2008 at 11:00 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
Ok, lets take a concrete example:

dates <- structure(c(8516, 8544, 8568, 8596, 8609, 8666, 8701, 8750, 8754,
8798, 8811, 8817, 8860, 8873, 8918, 8931, 8966, 9020, 9034, 9056
), class = "Date")
[1] "1993-04-26" "1994-10-18"

I want to be able to say: give me a monthly time series that spans
this range - i.e. it should start on 1993-04-01 and continue to
1994-11-01.  I should equally easily be able to say give me a yearly
time series, or every 2 months or every 3 months, or 2 weeks etc.

I don't think that cut.Date helps because I want to make a new series,
not divide up an existing one, similarly with to.period.  as.yearmon,
as.yearqtr etc, might be helpful but I'd need to stitch them together
myself and they don't return dates so I'd have to convert back for
plotting.   plot.zoo doesn't help because all the examples are regular
time series.

Hadley

Thread (31 messages)

Hadley Wickham Truncating dates (and other date-time manipulations) Sep 11 Whit Armstrong Truncating dates (and other date-time manipulations) Sep 11 Hadley Wickham Truncating dates (and other date-time manipulations) Sep 11 Gabor Grothendieck Truncating dates (and other date-time manipulations) Sep 11 Whit Armstrong Truncating dates (and other date-time manipulations) Sep 11 Avram Aelony database table merging tips with R Sep 11 Aaron Mackey database table merging tips with R Sep 11 Aaron Mackey database table merging tips with R Sep 11 Avram Aelony database table merging tips with R Sep 11 Jeffrey J. Hallman Truncating dates (and other date-time manipulations) Sep 11 Aaron Mackey database table merging tips with R Sep 11 Coey Minear database table merging tips with R Sep 11 Coey Minear database table merging tips with R Sep 11 Hadley Wickham Truncating dates (and other date-time manipulations) Sep 11 Hadley Wickham Truncating dates (and other date-time manipulations) Sep 11 Hadley Wickham Truncating dates (and other date-time manipulations) Sep 11 Marc Schwartz Truncating dates (and other date-time manipulations) Sep 11 Hadley Wickham Truncating dates (and other date-time manipulations) Sep 11 Moshe Olshansky database table merging tips with R Sep 11 Moshe Olshansky database table merging tips with R Sep 11 Gabor Grothendieck Truncating dates (and other date-time manipulations) Sep 11 Hadley Wickham Truncating dates (and other date-time manipulations) Sep 11 Gabor Grothendieck Truncating dates (and other date-time manipulations) Sep 11 Hadley Wickham Truncating dates (and other date-time manipulations) Sep 11 Gabor Grothendieck Truncating dates (and other date-time manipulations) Sep 11 Thomas Lumley database table merging tips with R Sep 11 Jeffrey J. Hallman Truncating dates (and other date-time manipulations) Sep 12 Jeff Ryan Truncating dates (and other date-time manipulations) Sep 12 Jeff Ryan Truncating dates (and other date-time manipulations) Sep 12 Hadley Wickham Truncating dates (and other date-time manipulations) Sep 12 Jeff Ryan Truncating dates (and other date-time manipulations) Sep 12