this =
structure(c(-0.012, -0.028, -0.044, -0.033, -0.039, -0.042), .Dim = c(3L, 2L),
.Dimnames = list(NULL, c("one", "two")), index = structure(
c(1313643600, 1313730000, 1313816400), tzone = "", tclass = "Date"),
.indexCLASS = "Date", .indexTZ = "", class = c("xts", "zoo"))
m1=last(this$one) - last(this$two)
m2=first(last(this$one,n=2)) - first(last(this$two,n=2))
m1 > 0 #returns a TRUE OR FALSE
m1 > m2 #breaks
我知道我可以使用coredata
來提取並比較。我不確定這是否是錯誤。似乎並不一致,比較工作,甚至數學運算符在xts對象上工作得很好,但將一個xt與另一個xts比較失敗。xts與另一個xts對象比較不起作用