tests/testthat/test_is_ppendemic.R

test_that("is_ppendemic correctly identifies endemic species", {
  # Test data
  species_list <- c("Aa aurantiaca", "Aa aurantiaaia", "Werneria nubigena")
  expected_result <- c("Endemic",
                       "Endemic - fuzzy matching",
                       "Not endemic")

  # Call the function
  result <- is_ppendemic(species_list, max_distance = 0.1)

  # Check the result
  expect_equal(result, expected_result)
})

Try the ppendemic package in your browser

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

ppendemic documentation built on Aug. 15, 2023, 9:08 a.m.