datetime - How to convert csv to R's xts object? -
Does anyone have an idea of how to convert it to ExtR object?
# Format: symbol, interval, date, time, open, high, low, closed, # cat test.csv ADF, 5,20141008 9 3500,0.8736,0.8738,0.8732, 0.8733,0,0 ADF, 5, 20141008,094000.0.8732,0.8736,0.8731,0.8735,0,0 ADF, 5,20141008,0 94500,0.8736,0.8737,0.8733,0.8737,0,0 ADF, 5,20141008, 095000,0.8736,0.8747, 0.8736,0.8746,0,0 ADF, 5,20141008 9 5500,0.8746,0.8748,0.8742,0.8743,0,0 ADF, 5,20141008,100000,0.8744,0.875,0.8742,0.8747, 0,0 ADF, 5,20141008, 100500.0.8747,0.8747,0.874,0.8745,0,0,0 EDF, 5,20141008,101000,0.8744,0.8744,0.874,0.8743,0,0 ADF, 5,20141008, 101500,0.8744 , 0.875,0.8744,0.875,0,0 ADF, 5,20141008,102000,0.8751,0.8752,0.8746,0.8751,0,0 I tried Read.csv ( ) , but me There is a problem in the other format ( read.csv changes the number in time, such as "091500" to 91500).
We can specify that the date and time columns are for colClasses Is considered as using character. This index also processes. If column 1 has multiple values, then it will be split into separate columns: Library (zoo) z In xts it as.xts (z) code>. For more information see the help file on read.zoo and see the zoo widget reading data in the zoo . Alternatively, use the same with colClasses with read.table .
Comments
Post a Comment