RE: [R] Matrix to dates

2003-12-09 Thread Gabor Grothendieck
z - matrix( c(1960,1960,1961,1,9,6), 3, 2 ) 1. Using chron: require(chron) chron( paste( z[,2], 1, z[,1], sep=/ ) ) 2. Using POSIXct: ISOdate( z[,1], z[,2], 1 ) # relative to GMT time zone or ISOdate( z[,1], z[,2], 1, tz= ) # relative to current time zone --- Date: Mon, 8

RE: [R] Matrix to dates

2003-12-08 Thread Andy Bunn
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,