1

I am new to R. How to format a column which contains over 1000 records of dates(this is the format i am looking for 2016-01-05, 2016-04-12). After importing the excel file in to R, above dates have changed to 16896 16903 and so on, what is the best way to format it.

CK-P
  • 35
  • 2
  • 1
    Sounds like your dates started in unix time, starting 1970-01-01. – Jon Spring Dec 21 '18 at 00:42
  • how are you importing the file? have you tried specifying the column type while importing the data into R ? look into `readxl()` and `column_type` – Aramis7d Dec 21 '18 at 06:26

1 Answers1

0
library(lubridate)
date <- ymd("2016-01-05")

this will do the trick for you. change the date with you column name

Hunaidkhan
  • 1,411
  • 2
  • 11
  • 21