当我尝试使用getSymbols
命令从Yahoo Finance获取数据时,我收到错误。在存储包的路径中似乎有些不对劲。无论如何要解决它?
> install.packages("quantmod")
Installing package into ‘/Users/yihuan/Library/R/3.1/library’
(as ‘lib’ is unspecified)
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left Speed
100 456k 100 456k 0 0 3850k 0 --:--:-- --:--:-- --:--:-- 3867k
The downloaded binary packages are in
/var/folders/p4/d1716x613c70sd0wq1r6hy3m0000gn/T//RtmpOaKkBC/downloaded_packages
> library(quantmod)
> DOW30 = getSymbols("^DJI",from = "2016-01-01",to = "2016-12-31" ,auto.assign = F)
Error in `colnames<-`(`*tmp*`, value = c("DJI.Open", "DJI.High", "DJI.Low", :
length of 'dimnames' [2] not equal to array extent
In addition: Warning message:
In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on '/var/folders/p4/d1716x613c70sd0wq1r6hy3m0000gn/T//RtmpOaKkBC/file43e4278a37cf'
以下添加的会话信息:
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] quantmod_0.4-5 TTR_0.23-0 xts_0.9-7 zoo_1.7-12
loaded via a namespace (and not attached):
[1] grid_3.1.2 lattice_0.20-33 tools_3.1.2 yaml_2.1.13