我熟悉 xts 子集化功能。但是,我找不到一种优雅的方法来对参数化的日期范围进行子集化。像这样的东西:
times = c(as.POSIXct("2012-11-03 09:45:00 IST"),
as.POSIXct("2012-11-05 09:45:00 IST"))
#create an xts object:
xts.obj = xts(c(1,2),order.by = times)
#filter with these dates:
start.date = as.POSIXct("2012-11-03")
end.date = as.POSIXct("2012-11-04")
#instead of xts["2012-11-03"/"2012-11-04"], do something like this:
xts[start.date:end.date]
有人知道吗?谢谢!