I want to change the date format of trendsDataD to that of trendsDataE and also I want to change the chr to numeric inorder to merge them into a single table.
Asked
Active
Viewed 44 times
-3
-
Welcome to StackOverflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). This will make it much easier for others to help you. – Jaap Mar 18 '18 at 09:21
1 Answers
1
you can give a try to this
eg
as<- "03-jan"
as<- strptime(as,"%d-%b")
it will give
"2018-01-03 IST"
now format according to your need
as <- format(as.Date(as),"%Y-%m-%d")
output
"2018-01-03"

girijesh96
- 455
- 1
- 4
- 16
-
@Mathew Jose Pallippadan, If my answer was able to solve your problem then you may mark it as accepted. Thank you – girijesh96 Mar 28 '18 at 05:42