[Xts-commits] r746 - pkg/xts/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Dec 23 16:32:44 CET 2012
Author: jryan
Date: 2012-12-23 16:32:43 +0100 (Sun, 23 Dec 2012)
New Revision: 746
Modified:
pkg/xts/R/xts.methods.R
Log:
o updated [.xts to handle new "Date" indexing upgrades
Modified: pkg/xts/R/xts.methods.R
===================================================================
--- pkg/xts/R/xts.methods.R 2012-12-18 13:22:16 UTC (rev 745)
+++ pkg/xts/R/xts.methods.R 2012-12-23 15:32:43 UTC (rev 746)
@@ -53,6 +53,7 @@
}
# check boundary; length check avoids Warning from max(), and
# any_negative ensures no NA (as of r608)
+ #if(max(i) > nr)
if(length(i) > 0 && max(i) > nr)
stop('subscript out of bounds')
#i <- i[-which(i == 0)]
@@ -64,10 +65,10 @@
if(inherits(i, "POSIXct")) {
i <- which(!is.na(match(.index(x), i)))
} else if(inherits(i, "Date")) {
- i <- which(!is.na(match(.index(x), as.POSIXct(as.character(i)))))
+ i <- which(!is.na(match(.index(x), as.POSIXct(as.character(i),tz=indexTZ(x)))))
} else {
# force all other time classes to be POSIXct
- i <- which(!is.na(match(.index(x), as.POSIXct(i))))
+ i <- which(!is.na(match(.index(x), as.POSIXct(i,tz=indexTZ(x)))))
}
i[is.na(i)] <- 0
} else
More information about the Xts-commits
mailing list