tests/testthat/test_age.R

context("age operations")

test_that("Age grouping ok", {

  x <- c(1, 2, 10, 20, 50, NA, 100)	       
  
  expect_equal(length(unique(levels(group_age(x, "years")))), max(na.omit(x)) - min(na.omit(x)))
  expect_equal(length(unique(levels(group_age(x, "decades")))), 10)
  expect_equal(length(unique(levels(group_age(x, "even", 5)))), 5)    

})

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.