I have a data set (.csv) with date (eg date of birth) information stored as 
character vectors that I’m attempting to transform to POSIXct objects using the 
package lubridate (1.7.4). The problem that I’m trying to address is that my 
two digit years are invariably (?) parsed to 20xx. For example,

x <- c("45-12-03","01-06-24","64-9-15”)
ymd(x)
[1] "2045-12-03" "2001-06-24" "2064-09-15”

These should be parsed as “1945-12-03” “2001-06-24” “1964-09-15”. 

I've tried to use parse_date_time()—based on the documentation it looks to me 
as though the argument cutoff_2000 should allow me to address this, but it’s 
unclear to me how to implement this. As an example, I’ve tried

parse_date_time(x, cutoff_2000 = 01)

but get the following error message (and similar for other similar attempts, 
including cutoff_2000 = 01L)

Error in parse_date_time(x, cutoff_2000 = 1) : 
  unused argument (cutoff_2000 = 1)

Thanks for your help!

Peter Nelson, PhD
Institute of Marine Sciences
University of California, Santa Cruz
Center for Ocean Health, Long Marine Lab
115 McAllistair Way
Santa Cruz, CA, 95076, USA
707-267-5896






        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to