0

I have a column with date in the format 20201020 (AAAAMMDD) as integer and a need to format as date 2020-10-20.

I`ve tried:

as.Date(MYDATE, format = "%m/%d/%y", origin = "1900-01-01")

AND

format(MYDATE, "%m/%d/%Y")

But returned just

NA
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
andhherson
  • 37
  • 4

1 Answers1

0

Using lubridate we can:

ymd(MY_DATE)
zx8754
  • 52,746
  • 12
  • 114
  • 209
andhherson
  • 37
  • 4