tests/testthat/test-zero-variance-function-on-rows.R

test_that(
    "Zero variance does it's thing.", {
        # given
        p <- 10
        z <- 3
        o <- 2 * p - z
        zeros <- c(rep(0, z))
        ones <- c(rep(1, o))
        X <- matrix(
            c(zeros, ones),
            nrow = p
        )
        # when
        result <- remove_zero_variance(X)
        # then
        expect_equal(
            nrow(result),
            z
        )
    }
)

Try the mvMAPIT package in your browser

Any scripts or data that you put into this service are public.

mvMAPIT documentation built on Sept. 26, 2023, 9:07 a.m.