tests/testthat/test-partition_gen.R

context("properties of generated partition matrix")

test_that(
  "partition_gen() generates a proper partition matrix", {
    
    P <- partition_gen(20, 4)
    expect_equal(sum(colSums(P)), 20)
    expect_equal(sum(rowSums(P)), 20)
    expect_equal(all(rowSums(P) == 1), TRUE)
    
  }
)

test_that(
  "partition_gen() generates a partition matrix of the correct dimensions", {
    
    P <- partition_gen(20, 4)
    expect_equal(nrow(P), 20)
    expect_equal(ncol(P), 4)
    
  }
)

Try the biclustermd package in your browser

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

biclustermd documentation built on June 17, 2021, 5:11 p.m.