[Xts-commits] r771 - pkg/xts/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 21 18:36:44 CEST 2013


Author: bodanker
Date: 2013-04-21 18:36:44 +0200 (Sun, 21 Apr 2013)
New Revision: 771

Modified:
   pkg/xts/R/xts.methods.R
Log:
- re-patch zero-width xts subsetting (bug #2669)


Modified: pkg/xts/R/xts.methods.R
===================================================================
--- pkg/xts/R/xts.methods.R	2013-04-21 14:27:11 UTC (rev 770)
+++ pkg/xts/R/xts.methods.R	2013-04-21 16:36:44 UTC (rev 771)
@@ -34,13 +34,8 @@
     USE_EXTRACT <- FALSE # initialize to FALSE
     if(is.null(dim(x))) {
       nr <- length(x)
-      if(nr==0) {
-        ix <- .index(x)
-        tmp <- .xts(rep(NA,length(ix)), ix)
-        indexClass(tmp) <- indexClass(x)
-        indexTZ(tmp) <- indexTZ(x)
-        return(tmp[i])
-      }
+      if(nr==0)
+        return( xts(rep(NA,length(index(x))), index(x))[i] )
       nc <- 1L
     } else {
       nr <- nrow(x)



More information about the Xts-commits mailing list