tests/testthat/test-plant_diveristy.R

test_that("input error", {
  expect_error(plant_diversity())
  expect_error(plant_diversity("w"))
  expect_error(plant_diversity("w",2000,2012))
})

test_that("test EXAMPLE data", {
  expect_equal(plant_diversity(EXAMPLE_data,2015,2018),dplyr::tibble(CDI_Tiemann = 42.25,
                                                                     Species_rotation = 13,
                                                                     Shannon = 2.56494936),
               ignore_attr = TRUE)
})

Try the SoilManageR package in your browser

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

SoilManageR documentation built on June 8, 2025, 9:36 p.m.