I downloaded a time series from Quandl, using the following command:
library(Quandl)
Quandl.auth("YOURSKEY")
mydata <- Quandl("TFGRAIN/SOYBEANS", authcode="YOURSKEY")
Now, I would like to use some functions from the quantmod package. However, I get an error message when I run the following code:
periodReturn(mydata, period="monthly")
# Error in try.xts(x) :
# Error in as.POSIXlt.character(x, tz, ...) :
# character string is not in a standard unambiguous format
I assume this is from the conversion of mydata
to an xts object. So, I try the following:
mydata_matrix <- as.matrix(mydata)
mydata_matrix_xts <- as.xts(mydata_matrix)
# Error in as.xts.matrix(mydata_matrix) :
# order.by must be either 'rownames()' or otherwise specified
rownames(mydata_matrix) <- mydata_matrix[,1]
mydata_matrix_xts <- as.xts(mydata_matrix)
# Error in as.POSIXlt.character(x, tz, ...) :
# character string is not in a standard unambiguous format
...but I still get errors. Any suggestions?