Skip to content
Prev 155807 / 398503 Next

Truncating dates (and other date-time manipulations)

on 09/11/2008 04:42 PM hadley wickham wrote:
Hadley,

What's wrong with:

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-01-01" "1993-01-01" "1993-01-01" "1993-01-01" "1993-01-01"
 [6] "1993-01-01" "1993-01-01" "1993-01-01" "1993-01-01" "1994-01-01"
[11] "1994-01-01" "1994-01-01" "1994-01-01" "1994-01-01" "1994-01-01"
[16] "1994-01-01" "1994-01-01" "1994-01-01" "1994-01-01" "1994-01-01"
[1] "1993-04-01" "1993-05-01" "1993-06-01" "1993-07-01" "1993-07-01"
 [6] "1993-09-01" "1993-10-01" "1993-12-01" "1993-12-01" "1994-02-01"
[11] "1994-02-01" "1994-02-01" "1994-04-01" "1994-04-01" "1994-06-01"
[16] "1994-06-01" "1994-07-01" "1994-09-01" "1994-09-01" "1994-10-01"
[1] "1993-04-01" "1993-04-01" "1993-06-01" "1993-06-01" "1993-06-01"
 [6] "1993-08-01" "1993-10-01" "1993-12-01" "1993-12-01" "1994-02-01"
[11] "1994-02-01" "1994-02-01" "1994-04-01" "1994-04-01" "1994-06-01"
[16] "1994-06-01" "1994-06-01" "1994-08-01" "1994-08-01" "1994-10-01"
[1] "1993-04-01" "1993-04-01" "1993-04-01" "1993-07-01" "1993-07-01"
 [6] "1993-07-01" "1993-10-01" "1993-10-01" "1993-10-01" "1994-01-01"
[11] "1994-01-01" "1994-01-01" "1994-04-01" "1994-04-01" "1994-04-01"
[16] "1994-04-01" "1994-07-01" "1994-07-01" "1994-07-01" "1994-10-01"
[1] "1993-04-01" "1993-04-01" "1993-04-01" "1993-07-01" "1993-07-01"
 [6] "1993-07-01" "1993-10-01" "1993-10-01" "1993-10-01" "1994-01-01"
[11] "1994-01-01" "1994-01-01" "1994-04-01" "1994-04-01" "1994-04-01"
[16] "1994-04-01" "1994-07-01" "1994-07-01" "1994-07-01" "1994-10-01"
[1] "1993-04-26" "1993-05-24" "1993-06-07" "1993-07-05" "1993-07-19"
 [6] "1993-09-13" "1993-10-25" "1993-12-06" "1993-12-20" "1994-01-31"
[11] "1994-02-14" "1994-02-14" "1994-03-28" "1994-04-11" "1994-05-23"
[16] "1994-06-06" "1994-07-18" "1994-09-12" "1994-09-26" "1994-10-10"


You can of course, format the dates as needed for aesthetic purposes.

Isn't that what you seem to be looking for?

BTW, seq.Date() supports the same time intervals designations.

HTH,

Marc Schwartz

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