getSymbols出错 - RStudio

时间:2017-04-17 20:01:17

标签: r

我不知道为什么但是在尝试使用getSymbols函数从“Oanda”下载数据时遇到错误:

library(quantmod)
require(quantmod)

tickers <- c("USD/EUR","EUR/BRL","USD/ARS","USD/BRL","USD/CLP","USD/COP")
tickers2 <- c("USDEUR","EURBRL","USDARS","USDBRL","USDBRL","USDCLP","USDCOP")

getSymbols(tickers, src = "oanda", env = parent.frame(n=1),  
       from = "2014-01-01", to = Sys.Date(), auto.assign = TRUE, 
       warning = FALSE)

Closeprices <- do.call(cbind, lapply(tickers2, function(x) get(x)))
head(Closeprices)

dat1 <- as.data.frame(Closeprices)
dat1$date <- time(Closeprices)

head(dat1)

并返回以下错误:

> getSymbols("USD/EUR", src = "oanda", env = parent.frame(n=1),  
+            to = Sys.Date(), auto.assign = TRUE, 
+            warning = FALSE)
Error in charToDate(x) : 
  character string is not in a standard unambiguous format

过去效果很好,但现在崩溃了。

你可以帮帮我吗?

0 个答案:

没有答案