In R , I have a vector of strings representing dates in two different formats:
- "month / day / year"
- "month day, year"
The first format has a two-digit year, so my vector looks something like this:
c("3/18/75", "March 10, 1994", "10/1/80", "June 15, 1979",...)
I want to put dates in a vector in a standard format. This should be easy using the function mdy
from the package lubridate
, except when I pass it the first format, it returns an unwanted century.
mdy("3/18/75")
returns "2075-03-18 UTC"
Does anyone know how it can return a date in the 20th century? This is "1975-03-18 UTC" . Any other decision on how to standardize dates would also be greatly appreciated.
I am running lubridate_1.3.3 version if that matters.
source
share