I have a data with two columns of values and one column of date in %Y-%m format. I learnt to use xts to transform dataframe to time series data. However, the result doesn't output the date correctly. In the end, I need to plot cnt vs YrMon(ordered by time on x-axis) and total vs YrMon.
YrMon cnt total
1: 2016-08 14.42857 705.071429
2: 2016-09 13.21429 3.642857
3: 2017-04 13.28571 344.000000
4: 2016-07 14.21429 673.142857
.....
Any suggestion? Thank you.