I have a CSV file containing data with the first column in Unix time stamp. How can I convert it to xts form directly? Currently I am trying to read the file and convert using as.xts
, but I get error messages every way I try.
An example of a code I used:
Data <- read.zoo("data.csv", index.column = 1, origin="01/01/1970",
sep = ",", header = TRUE, FUN = as.POSIXct)
as.xts(Data)
1st 2 lines of the csv:
1366930371 143.7 0.25275
1366930368 143.7 0.02664867