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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 26 14:41:20 CEST 2013


Author: bodanker
Date: 2013-08-26 14:41:20 +0200 (Mon, 26 Aug 2013)
New Revision: 788

Modified:
   pkg/xts/R/xts.R
Log:
- fix bug #4775


Modified: pkg/xts/R/xts.R
===================================================================
--- pkg/xts/R/xts.R	2013-08-25 14:06:42 UTC (rev 787)
+++ pkg/xts/R/xts.R	2013-08-26 12:41:20 UTC (rev 788)
@@ -65,11 +65,13 @@
   }
 
 
-  if(!is.null(x) && !isOrdered(order.by, strictly=!unique) ) {
+  if(!isOrdered(order.by, strictly=!unique)) {
     indx <- order(order.by)
-    if(NCOL(x) > 1 || is.matrix(x) || is.data.frame(x)) {
-      x <- x[indx,,drop=FALSE]
-    } else x <- x[indx]
+    if(!is.null(x)) {
+      if(NCOL(x) > 1 || is.matrix(x) || is.data.frame(x)) {
+        x <- x[indx,,drop=FALSE]
+      } else x <- x[indx]
+    }
     order.by <- order.by[indx]
   }
 



More information about the Xts-commits mailing list