r - Convert from character to Date -


i running date issues when working dates in r.

here's situation-

i have data set based on dates , got date field converted character date in r using following code

o1$date <- as.date(o1$date , "%m/%d/%y") 

(my dataset o1 , date name of date column)

my date column has following values

"1/1/2013"  "1/1/2014"  "1/10/2013" "1/10/2014" "1/11/2013" "1/11/2014" 

however when convert char date following dates

"2020-01-01" "2020-01-01" "2020-01-10" "2020-01-10" "2020-01-11" 

any suggestions on problem , how work around it?

look @ ?strptime see formatting options times , dates. need use %y rather %y 2 digit year.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -