What are your favorite Rstudio addins?

Yeah. At work excel is everywhere, and even if the data have gone from that to .csv, I often find dates columns as numeric columns once it gets into R. I've been using something like as.Date() with an origin argument (that I always have to google b/c I forget the date that goes in there), so this function will be great to have.

1 Like

Yeah, Excel dates as numbers are a nightmare. Here is what I use

df$date <- as.character(as.Date(as.POSIXct((as.numeric(as.character(df$date)) * 86400), 
          origin = "1899-12-30", tz = "GMT")))
1 Like

I don't know whether that 5 * as. is a thing of horror or strange beauty ... :open_mouth:

1 Like

@pditty what pkg/how are you using to read the data in? readxl has that functionality upfront, so I would presume you wouldn't truly need such a heavy workaround: