save state; test clustering not OK, all others OK
[epclust.git] / epclust / tests / testthat / test.filter.R
index 9d1916d..a0263a4 100644 (file)
@@ -6,13 +6,13 @@ test_that("[time-]serie filtering behave as expected",
        # Currently just a mean of 3 values
        M = matrix(runif(1000,min=-7,max=7), ncol=10)
        ref_fM = stats::filter(M, c(1/3,1/3,1/3), circular=FALSE)
-       fM = epclust:::.epclustFilter(M)
+       fM = epclust:::epclustFilter(M)
 
        #Expect an agreement on all inner values
        expect_equal(dim(fM), c(100,10))
-       expect_equal(fM[2:99,], ref_fM[,2:99])
+       expect_equal(fM[2:99,], ref_fM[2:99,])
 
-       #For border values, just apply a "by-hand" mean
-       expect_equal(fM[1,], colMeans(rbind(M[1,],M[2,],M[100,])))
-       expect_equal(fM[100,], colMeans(rbind(M[100,],M[99,],M[1,])))
-}
+       #Border values should be unchanged
+       expect_equal(fM[1,], M[1,])
+       expect_equal(fM[100,], M[100,])
+})