Re: [R] c() and dates

2014-10-03 Thread Therneau, Terry M., Ph.D.
Well duh -- type "c.Date" at the command prompt to see what is going on. I suspected I was being dense. Now that the behaior is clear can I follow up on David W's comment that redfining the c.Date function as structure(c(unlist(lapply(list(...), as.Date))), class = "Date") allows for a

Re: [R] c() and dates

2014-10-03 Thread David Winsemius
On Oct 3, 2014, at 7:19 AM, Therneau, Terry M., Ph.D. wrote: > I'm a bit puzzled by a certain behavior with dates. (R version 3.1.1) > > > temp1 <- as.Date(1:2, origin="2000/5/3") > > temp1 > [1] "2000-05-04" "2000-05-05" > > > temp2 <- as.POSIXct(temp1) > > temp2 > [1] "2000-05-03 19:00:00 CD

Re: [R] c() and dates

2014-10-03 Thread David Winsemius
On Oct 3, 2014, at 7:19 AM, Therneau, Terry M., Ph.D. wrote: > I'm a bit puzzled by a certain behavior with dates. (R version 3.1.1) > > > temp1 <- as.Date(1:2, origin="2000/5/3") > > temp1 > [1] "2000-05-04" "2000-05-05" > > > temp2 <- as.POSIXct(temp1) > > temp2 > [1] "2000-05-03 19:00:00 CD