r - converting mddyy date to date -
i have date column in .csv spreadsheet generated in inquisit.
the format mddyy
, 13th of july
71315
. r recognizes integer.
can recommend way convert iso 8601
date format?
since mention day 2 numbers, use little sprintf()
magic add zeros out front.
as.date(sprintf("%06d", 71315), "%m%d%y") # [1] "2015-07-13"
the sprintf()
call here adds zeros 6 characters , turn character vector, as.date()
accept it.
sprintf("%06d", 71315) # [1] "071315"
Comments
Post a Comment