0

Is there a way to convert numbers to Date. Actually this dataframe I downloaded from excel. But After importing, Column 4 header got converted to numbers(43759.708333333336). Now how do I convert it back to date?

df <- structure(list(Parameter = c("Generation", "Condensate Flow to DEA."
), Unit = c("MW", "TPH"), Design = c(660, 1515.796), `43759.708333333336` = c(659.56473061557, 
1564.58185369488)), row.names = c(NA, -2L), class = "data.frame")

df
               Parameter  Unit   Design     43759.708333333336
1              Gene       MW    660.000           659.5647
2              Condensate PH    1515.796          1564.5819
Dev P
  • 449
  • 3
  • 12
  • It seems easier to convert your data from wide to long, in order to avoid column name formatting issues. That aside, in order to convert `43759.708333333336` you need to know the `origin`. For example, `as.Date(43759.708333333336, origin = "1900-01-01")` will give a different date than `as.Date(43759.708333333336, origin = "1900-02-01")`. So what's the `origin` in your case? – Maurits Evers Oct 21 '19 at 09:19
  • I've closed your question as a dupe for now, as the linked post seems to be address the same issue. Please leave a comment and more details if this is different. – Maurits Evers Oct 21 '19 at 09:21

0 Answers0