I have a large dataframe (6,300 columns * 5,480 rows) of daily prices of stocks. The data frame looks like this:
All the columns are marked numeric in the data frame (except the first one "Date", this is unknown). When I transform the data frame into an xts object, it changes the Date-column into the row names (which is good). And it also changes all my numeric columns into character columns (NOT GOOD).
I used the following code for the transformation:
XTS.PRICES <- xts(Prices[,-1], order.by=as.Date(Prices$Date))