[Xts-commits] r690 - pkg/xts/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jul 23 16:58:55 CEST 2012
Author: bodanker
Date: 2012-07-23 16:58:55 +0200 (Mon, 23 Jul 2012)
New Revision: 690
Modified:
pkg/xts/R/toperiod.R
Log:
- to.period now checks that 'x' is not zero-length/width (David Turk)
Modified: pkg/xts/R/toperiod.R
===================================================================
--- pkg/xts/R/toperiod.R 2012-07-20 20:59:08 UTC (rev 689)
+++ pkg/xts/R/toperiod.R 2012-07-23 14:58:55 UTC (rev 690)
@@ -36,6 +36,9 @@
xo <- x
x <- try.xts(x)
+ if(NROW(x)==0 || NCOL(x)==0)
+ stop(sQuote("x")," contains no data")
+
if(any(is.na(x))) {
x <- na.omit(x)
warning("missing values removed from data")
More information about the Xts-commits
mailing list