tests/testthat/testthat_post.R

test_that("`post()` properly handles intercept only", {
  data("POSTmData")
  
  y <- as.integer(x = metadata[,"GC"] == "BV")
  X <- metadata[,"mRace"]
  
  expect_error(post(y = y, 
               X = matrix(1, length(y), 1L), 
               OTU = otu[,1:20], 
               tree = otutree,
               cValues = seq(0,0.05,by=0.01)),
               "an intercept only model should be defined as `X = NULL`")
})

Try the POSTm package in your browser

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

POSTm documentation built on May 29, 2024, 9:24 a.m.