再現可能なコード:
#install.packages('quantmod')
require(quantmod)
# Downloading data and merging them
getSymbols(c('^GSPC', '^GDAXI'), from = '1900-01-01')
X <- na.omit(merge(GSPC, GDAXI))
SP500 <- X[,substr(colnames(X), 1, 4) == 'GSPC']
DAX <- X[,substr(colnames(X), 1, 5) == 'GDAXI']
# Code
apply.quarterly(SP500, Hi)
私のR
セッションでは、最後のコマンドが返されます
Error in coredata.xts(x) : currently unsupported data type
これは非常に奇妙ですis(SP500)
。
> is(SP500)
[1] "xts" "oldClass" "xtsORzoo"
に適していperiod.apply()
ます。私のに何か問題がある可能性がありますsessionInfo()
:
R version 3.0.1 (2013-05-16)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats4 stats graphics grDevices datasets utils methods base
other attached packages:
[1] quantmod_0.4-0 TTR_0.22-0 Defaults_1.1-1
[4] PerformanceAnalytics_1.1.0 xts_0.9-4 yuima_0.1.210
[7] zoo_1.7-10 rcom_3.1-2 rscproxy_2.0-5
loaded via a namespace (and not attached):
[1] grid_3.0.1 lattice_0.20-15 timeDate_3010.98 timeSeries_3010.97
[5] tools_3.0.1