【发布时间】:2019-05-15 18:20:57
【问题描述】:
我尝试使用Quantmod 包从Yahoo finance 下载数据,如下所示,但未能获取任何数据。
library(quantmod)
> get(getSymbols("^FTSE"))
Error in get(getSymbols("^FTSE")) : object '^FTSE' not found
In addition: Warning message:
^FTSE contains missing values. Some functions will not work if objects contain missing values in the middle of the series. Consider using na.omit(), na.approx(), na.fill(), etc to remove or replace them.
任何关于它失败的想法将不胜感激。
以下是我的会话信息
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] quantmod_0.4-14 TTR_0.23-4 xts_0.11-2 zoo_1.8-5
loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0 curl_3.3 grid_3.6.0
[5] lattice_0.20-38
【问题讨论】:
-
为什么在
getSymbols()周围使用get()?你到底想做什么? -
改用alphavantage api,不再维护雅虎财经
-
@JaredMarks:Yahoo Finance 得到维护,但数据质量比过去差,所以我不建议使用它们。也许您正在考虑 Google 财经(他们不再提供数据)?我推荐Tiingo 或Alpha Vantage。
标签: r time-series quantmod