[R] Matrix to dates

Andy Bunn abunn at montana.edu
Mon Dec 8 22:57:28 CET 2003


See ?DateTimeClasses, ?strptime, and ?as.character

This example from strptime should get you going:

## read in date/time info in format 'm/d/y h:m:s'
     dates <- c("02/27/92", "02/27/92", "01/14/92",
                "02/28/92", "02/01/92")
     times <- c("23:03:20", "22:29:56", "01:03:30",
                "18:21:03", "16:56:26")
     x <- paste(dates, times)
     z <- strptime(x, "%m/%d/%y %H:%M:%S")
     z


Good luck, Andy




More information about the R-help mailing list