Skip to content

month-day-year to Date

2 messages · Terry Therneau, Gabor Grothendieck

#
I have a data from with 3 numeric variables, and wish to create a Date object.
The old "date" library had a function mdy.date to do this.  I've chased all of
the See Also sections I can find for the Date class, and didn't find anything
comparable.

  Yes, I can use as.Date(paste(data$year+1900, data$month, data$day), sep='/'))
but it seems odd pack something together that will immediately be unpacked.

	Terry Therneau
#
I would use paste but as.Date(ISOdate(...)) is another possibility although
it uses paste internally itself.
On Sun, Dec 28, 2008 at 2:11 PM, Terry Therneau <therneau at mayo.edu> wrote: