在 R 中使用 Quantmod 包加载日本股票信息
我在使用 R/quantmod 包时遇到一个问题。我可以获取韩国的股票信息,但无法获取日本的信息:
getSymbols("DEXKOUS",src="FRED") #load Korea
[1] "DEXKOUS"
getSymbols("DEXJPUS",src="FRED") #load Japan
Error as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
欢迎您的评论。
sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] PerformanceAnalytics_1.0.3.2 quantmod_0.3-17 TTR_0.21-0
[4] xts_0.8-2 zoo_1.7-4 Defaults_1.1-1
[7] Rweibo_0.0-5 rjson_0.2.5 digest_0.5.1
[10] RCurl_1.6-6.1 bitops_1.0-4.1
loaded via a namespace (and not attached):
[1] grid_2.13.1 lattice_0.19-30 tools_2.13.1
I encounter one problem of using R/quantmod package. I can get the stock information for Korea, but I failed in getting the information for Japan:
getSymbols("DEXKOUS",src="FRED") #load Korea
[1] "DEXKOUS"
getSymbols("DEXJPUS",src="FRED") #load Japan
Error as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
Your comments are welcome.
sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] PerformanceAnalytics_1.0.3.2 quantmod_0.3-17 TTR_0.21-0
[4] xts_0.8-2 zoo_1.7-4 Defaults_1.1-1
[7] Rweibo_0.0-5 rjson_0.2.5 digest_0.5.1
[10] RCurl_1.6-6.1 bitops_1.0-4.1
loaded via a namespace (and not attached):
[1] grid_2.13.1 lattice_0.19-30 tools_2.13.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你在问题中给出的例子也适合我。我得到了 1971 年以来日元兑美元汇率的时间序列。
然而,如果您正在寻找股价数据而不是外汇(您确实提到了股票信息?)那么也许您应该尝试 RFinanceYJ 软件包,它可以从 Yahoo! 中提取股价数据。日本。
The example you give in your question works fine for me too. I get a time series of the yen-dollar rate from 1971 onwards.
However, if you are looking for share price data rather than forex (you did say stock information?) then perhaps you should try the RFinanceYJ package, which extracts share price data from Yahoo! Japan.