0

I created a data frame with a set of data imported from excel. The Dates are in the serial format.

I looked around on the forum and tried to transform the column in my data frame using the following:

ADF <- transform(ADF, CurrentTermEndDate = as.Date(as.numeric(ADF[,2]) ,origin ="1899-12-30"))

But it only returns NA for all the values it updates. Is there something I'm missing?

Buzz Lightyear
  • 824
  • 1
  • 7
  • 18
  • 3
    Maybe use `as.numeric(as.character(ADF[,2]))`? `ADF[,2]` might be a factor, but we can't really help unless you include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). – Jaap Jun 15 '16 at 20:38
  • 1
    Possible duplicate of [Converting excel DateTime serial number to R DateTime](http://stackoverflow.com/questions/19172632/converting-excel-datetime-serial-number-to-r-datetime) – Buzz Lightyear Jun 15 '16 at 20:44

0 Answers0