[Solved] Fix incomplete character string for year “2016” from “0016” in R [closed]


Kindly go through following R console code snippet:

> dates <- c("10/23/16", "10/24/16")
> dates
[1] "10/23/16" "10/24/16"
> Dates <- as.Date(dates,
        +   format = "%m/%d/%y")
> Dates
[1] "2016-10-23" "2016-10-24"

Hope it works for you!

solved Fix incomplete character string for year “2016” from “0016” in R [closed]