我正在尝试使用rollapplyr
使用xtstmp
stl
的头部xtstmp
对名为 Close
2012-08-15 09:30:00 3434.51
2012-08-15 10:00:00 3426.24
2012-08-15 10:30:00 3438.41
2012-08-15 11:00:00 3436.79
2012-08-15 11:30:00 3441.57
的500行单列xts对象进行滑动窗口分析,如下所示:
dput(head(xtstmp,10))
structure(c(4310.77, 4332.24, 4334.37, 4334.37, 4363.17, 4372.78,
4372.61, 4360.63, 4371.45, 4377.86), class = c("xts", "zoo"), .indexCLASS = structure("timeDate", package = "timeDate"), tclass = structure("timeDate", package = "timeDate"), .indexTZ = "GMT", tzone = "GMT", .CLASS = "double", index = structure(c(1369400400,
1369404000, 1369407600, 1369411200, 1369414800, 1369648800, 1369652400,
1369656000, 1369659600, 1369663200), tzone = "GMT", tclass = structure("timeDate", package = "timeDate")), .Dim = c(10L,
1L))
的输出是:
rollapplyr
但每当我尝试使用rollapplyr(xtstmp,100,function(x) stl(x, s.window="periodic"),fill=NA)
这样的时候:
Error in match(x, table, nomatch = 0L) : 'match' requires vector arguments
我收到以下错误:
function (x, table, nomatch = NA_integer_, incomparables = NULL)
.Internal(match(x, table, nomatch, incomparables))
在Rstudio中使用Rerun和debug在匹配函数中暂停:
x
...参数table
和stl
有正式的类timeDate(POSIXct),大概是匹配函数不认为它需要的向量输入?
这是一个已知问题,还是我的一个明显错误? (简单地将xtstmp
应用于整个class Controller {
constructor() {
// overwrite handleClick() with its bound version
this.handleClick = this.handleClick.bind(this);
}
open() {
$('body').on('click', this.handleClick);
}
close() {
$('body').off('click', this.handleClick);
}
}
工作正常)