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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 15 19:23:04 CET 2013


Author: bodanker
Date: 2013-12-15 19:23:04 +0100 (Sun, 15 Dec 2013)
New Revision: 799

Modified:
   pkg/xts/R/xts.methods.R
Log:
- [.xts more robust to multiple zeros in 'i'


Modified: pkg/xts/R/xts.methods.R
===================================================================
--- pkg/xts/R/xts.methods.R	2013-12-06 20:48:07 UTC (rev 798)
+++ pkg/xts/R/xts.methods.R	2013-12-15 18:23:04 UTC (rev 799)
@@ -113,7 +113,7 @@
     # subset is picky, 0's in the 'i' position cause failures
     zero.index <- binsearch(0, i, NULL)
     if(!is.na(zero.index))
-      i <- i[ -1L:-zero.index ]  # at least one 0; binsearch returns location of last 0
+      i <- i[i!=0]  # at least one 0; remove them all
 
     if(length(i) <= 0 && USE_EXTRACT) 
       USE_EXTRACT <- FALSE



More information about the Xts-commits mailing list