Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

converting date (month) only to XTS class in R

$
0
0

I have a csv file which I read in R

library(xts)
mydata <- read.csv("abc.csv") ==> it becomes a dataframe

Months      Round Premium
December     2    1000
December     1    2000
November     2    1500
November     1    1200
...
January      2    1600
January      1    1200

The months column becomes a character. I would like to make it as xts object for the months column to be index, and the rest of the other columns to be matrix. This is because I wish to plot as time series model.

I have difficulties in making the months column as index.

Anyone can help ?

==> when


Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>