tests/testthat/test-quantize.R

test_that("`quantize` obeys fixture requests", {
      ps <- ps_simulate()
      comm <- ps_get_comm(ps, spatial = FALSE)

      q <- quantize(comm, priority = "rows")
      expect_equal(rowSums(q), rowSums(comm))
      expect_false(all(colSums(q) == colSums(comm)))

      q <- quantize(comm, priority = "cols")
      expect_equal(colSums(q), colSums(comm))
      expect_false(all(rowSums(q) == rowSums(comm)))
})

Try the phylospatial package in your browser

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

phylospatial documentation built on June 8, 2025, 1:14 p.m.