Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Lubridate Date parsing is one year off [duplicate]

$
0
0

This question already has an answer here:

Within R, I'm trying to convert a text string into a Date variable type using lubridate's as.Date function.

I have a vector of values such as:

Dates

11/28/2019 11/29/2019

I am attempting to convert these to standard date variables using this as.Date function:

as.Date(Dates, "%m/%d/%y")

I do not receive an error message, and it correctly interprets the month and date, but for some reason it's outputting the wrong year - one year ahead:

"2020-11-28""2020-11-29"

I have no earthly idea why it is incorrectly interpreting the year in this way. Any help is appreciated!


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>