tests/testthat/test-subset_gmat.R

context("subset_gmat")

test_that("min.nfeats", {
  zeallot::`%<-%`(c(g, npp), subset_gmat(object=M, Gmat=G[1:3,], min.nfeats=3))
  expect_equal(as.numeric(g), rep(1, 3))
  expect_equal(npp, c(pwy1=3))
  
  zeallot::`%<-%`(c(g, npp), subset_gmat(object=M, Gmat=G[1:3,], min.nfeats=0))
  expect_equal(as.numeric(g), c(1,1,1,0,1,1))
  expect_equal(npp, c(pwy1=3, pwy2=2))
  
  expect_error(subset_gmat(object=M, Gmat=G[1:3,], min.nfeats=4))
})
jdreyf/PANTS documentation built on July 18, 2019, 10:12 a.m.