tests/testthat/test_neatmap.R

context("neatmap sorting")

test_that("neatmap sorting works correctly", {

  data(peerj32)
  pseq <- core(subset_samples(peerj32$phyloseq, group == "Placebo"),
      detection = 5, prevalence = 50/100)
  
  # For phyloseq
  expect_true("sample-9" %in% neatsort(pseq, target = "sites"))
  expect_true("Lactococcus" %in% neatsort(pseq, target = "species"))  

  # For matrices
  expect_true("sample-9" %in% neatsort(abundances(pseq), target = "cols"))
  expect_true("Lactococcus" %in% neatsort(abundances(pseq), target = "rows"))  
  
})

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.