可重现的代码:
op <- par(no.readonly = TRUE)
Sys.setenv(TZ = 'UTC')
# *********************************
# 1. Installing packages
# *********************************
install.packages('quantmod')
# *********************************
# 2. Loading packages
# *********************************
require(compiler)
require(quantmod)
# *********************************
# 3. Downloading and preparing data
# *********************************
env <- new.env()
Symbols <- c('SPY', 'QQQ', 'XLF', 'GLD')
getSymbols(Symbols = Symbols, env = env, from = '1950-01-01')
args <- eapply(env = env, FUN = function(x){na.omit(merge(OpCl(x)))})
do.call(what = function(x){x}, args = args)
最后一个命令返回
Error in (function (x) :
unused arguments (GLD = c(-0.00112536574386668, 0.00651831872330866, 0.00446927374301676, -0.00289661319073087, 0.00267082127754281, 0.000883977900552502, 0.00665188470066513, -0.0055102490632577, 0.00220848056537104, -0.0131723380900108, 0.0124333925399644, -0.00484688257325394, -0.00419426048565119, 0.00479452054794516, 0.000685714285714401, 0.00161401890707857, 0.00687915615684465, -0.00479890310786113, -0.00249433106575958, -0.00704705614912482, 0.00591850671522876, 0.000225580870742315, 0.00203942895989107,
-0.00407239819004523, 0.00226398007697526, 0.00428990742831337, -0.00112561909049991, -0.00591985428051012, 0.00758620689655176, -0.00114025085518821, 0.000930665425779686, -0.00140186915887841, -0.00187134502923969, -0.00776836158192085, -0.00593965312425759, -0.000952607763753277, 0, 0.00188146754468477, 0.00495399858457191, 0.00308129888599207, 0.00236854571293232, -0.00914419695193436, 0.00308641975308643, 0.00992438563327047, 0.00070191857744506, -0.006818716200
我需要args
在一个类似矩阵的对象中强制,这是一个列表。