[R] Excel date to R format

Ken Takagi katakagi at bu.edu
Tue Apr 13 16:49:17 CEST 2010


One useful package is "chron":

example:
library(chron)
#convert excel time to date time format
etime = 39965.0004549653
orig =chron("12/30/1899"); #  "origin" of excel time.
date.time = orig + etime;
substr(as.character(date.time), 2, 18) #  as character without parentheses.

HTH,

Ken



More information about the R-help mailing list