0

I want to convert mmm-yy(Jan-85) date format into yyyy-mm-dd (1985-01-02)date format in R.

Anjaly
  • 5
  • 4
  • check this out: [issue](https://stackoverflow.com/questions/57925731/r-convert-month-and-2-digit-year-into-date/57926945#57926945) – slava-kohut Sep 16 '19 at 21:32

1 Answers1

0

One option is to paste the day and convert it to Date class with as.Date and the appropriate format

as.Date(paste0("Jan-85", "-02"), "%b-%y-%d")
#[1] "1985-01-02"
akrun
  • 874,273
  • 37
  • 540
  • 662
  • I have a column named Date which has a series of Dates ie,Jan-18,feb-18, Mar-18 and so. I still have trouble converting the entire column into 1980-01-01 format. Please advise. Thanks – Anjaly Sep 17 '19 at 13:51
  • @Anjaly Not clear from the comments. Can you dput the input – akrun Sep 17 '19 at 15:53
  • Date Feb-88 Mar-88 Apr-88 May-88 Final output should be in the following format 2/2/1988 2/3/1988 2/4/1988 2/5/1988 – Anjaly Sep 17 '19 at 16:28
  • Thank you so much . It works. – Anjaly Sep 17 '19 at 20:21