[Dplr-commits] r732 - pkg/dplR/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 24 10:23:13 CET 2014


Author: mvkorpel
Date: 2014-03-24 10:23:12 +0100 (Mon, 24 Mar 2014)
New Revision: 732

Modified:
   pkg/dplR/inst/unitTests/runit.dplR.R
Log:
A unit test for rwi.stats(), testing that 'n' is correct when period="common"

Modified: pkg/dplR/inst/unitTests/runit.dplR.R
===================================================================
--- pkg/dplR/inst/unitTests/runit.dplR.R	2014-03-24 08:53:29 UTC (rev 731)
+++ pkg/dplR/inst/unitTests/runit.dplR.R	2014-03-24 09:23:12 UTC (rev 732)
@@ -590,6 +590,20 @@
                 msg="Reordered input is handled correctly")
 }
 
+test.rwi.stats <- function() {
+    ## Setup
+    v.1 <- 1 + runif(300)
+    range.1 <- 51:400
+    rnames.1 <- as.character(range.1)
+    df.1 <- data.frame(col1 = c(v.1, rep(NA, 50)),
+                       col2 = c(rep(NA, 25), v.1, rep(NA, 25)),
+                       col3 = c(rep(NA, 50), v.1),
+                       row.names = rnames.1)
+    ## Test
+    checkEquals(3, rwi.stats(df.1, period="common")[["n"]])
+    ## Needs more tests
+}
+
 test.sens1 <- function() {
     ## Setup
     SAMP.SIZE <- 1000



More information about the Dplr-commits mailing list