tests/testthat/test_mappings.R

context("taxonomic map")

test_that("levelmap works correctly", {

  data(dietswap)
  tt <- tax_table(dietswap)

  # For phyloseq

  expect_equal(map_levels('Akkermansia', from = 'Genus', to = 'Phylum', tt), "Verrucomicrobia")
  expect_equal(map_levels('Verrucomicrobia', from = 'Phylum', to = 'Genus', tt)$Verrucomicrobia, "Akkermansia")
})

Try the microbiome package in your browser

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

microbiome documentation built on Nov. 8, 2020, 5:08 p.m.