请将此数据结构放入R中以重现我的示例:
dX <- structure(c(3272.1, 3271.48, 3281.03, 3267.08, 3260.65, NA, 1616.3,
1620.1, 1639.9, 1637.4, 1669.6, 1662.2, 528.385, 529.268, 531.022,
532.424, NA, NA), .indexTZ = "", class = c("xts", "zoo"), .indexCLASS = c("POSIXct",
"POSIXt"), tclass = c("POSIXct", "POSIXt"), tzone = "", index = structure(c(1345147200,
1345406400, 1345492800, 1345579200, 1345665600, 1345752000), tzone = "", tclass = c("POSIXct",
"POSIXt")), .Dim = c(6L, 3L), .Dimnames = list(NULL, c("M1WO.Index",
"GC1.COMB.Comdty", "JGAGGUSD.Index")))
Run Code Online (Sandbox Code Playgroud)
现在试试这段代码:
library(PerformanceAnalytics)
library(quantmod)
library(timeSeries)
charts.PerformanceSummary(R = dX)
Run Code Online (Sandbox Code Playgroud)
并得到此错误:
Error in UseMethod("time<-") :
no applicable method for …Run Code Online (Sandbox Code Playgroud)