Conversion to xts does not work because data is of type 'character' and cannot be converted to 'numeric'
问题 I have the following data set data date PX_LAST.USGG10YR Index PX_LAST.GSWISS10 Index 1 2012-12-31 1.7574 0.526 2 2013-01-31 1.9849 0.789 3 2013-02-28 1.8756 0.698 4 2013-03-29 1.8486 0.716 5 2013-04-30 1.6717 0.570 6 2013-05-31 2.1282 0.722 7 2013-06-28 2.4857 1.027 8 2013-07-31 2.5762 1.023 9 2013-08-30 2.7839 1.069 10 2013-09-30 2.6100 1.021 The class of the date column is > class(data[,1]) [1] "POSIXct" "POSIXt" The class of the other two columns is class(data[,2]) [1] "numeric" class