r - xlsx data column having date is getting converted to unidentifiable values in the date column -


i have data in .xlsx form , have done sorting , deleting in data. after cleaning have .xlsx file in date column replaced number. how can change date , extract month every row?

e.g.: initial

(i have not mentioned columns used cleaning , not used eta,etb,etc )

 city        eta            etb             etc mumbai  24-05-2017       -              - mumbai  26-05-2017      01-06-2017  10-06-2017 mundra  26-05-2017      28-05-2017  07-06-2017 mundra  29-05-2017      stream     

result

after cleaning (i have randomly taken row since sorted hard find same data since big)

 city            eta     etb    etc  mumbai         42823   -       -  mumbai         42823   stream  -  mumbai         42823   stream  -  mumbai         42823   stream  - 

i want dates in eta, etb , etc, getting converted string after cleaning. how solve this?

i suggest using lubridate package, e.g. in following way:

require(lubridate) data$etb = strptime(data$etb,"%d-%m-%y") 

without doing r treats data factor or string.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -