I have the following:
"0014-06-30"
And I'd like to change it to:
"0000-06-30"
How would I do this in R?
Everything that I'm reading is very focused on converting strings to dates rather than changing around the elements inside a date.
> x <- as.Date('0014-06-30')
> x
[1] "0014-06-30"
> library(lubridate)
> year(x)
[1] 14
> year(x) <- 0
> x
[1] "0000-06-30"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With