tests/testthat/test_top_results.R

test_that("top_results() works faultlessly.", {
  # load pre-computed results (obtaines via `distinct_test`)
  data("res", package = "distinct")
  
  # Visualize significant results:
  top_1 = top_results(res)

  # Visualize significant results:
  top_2 = top_results(res, significance = 0.1)

  # Visualize significant results:
  top_3 = top_results(res, global = FALSE)
    
  # Visualize significant results from a specified cluster of cells:
  top_4 =  top_results(res, cluster = "Dendritic cells")
  
  expect_is(top_1, "data.frame")
  expect_is(top_2, "data.frame")
  expect_is(top_3, "data.frame")
  expect_is(top_4, "data.frame")
})

Try the distinct package in your browser

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

distinct documentation built on Nov. 8, 2020, 8:20 p.m.