tests/testthat/test_get_taxa.R

library("testthat")
library("neotoma2")

context("`get_taxa()` and `get_taxon()` functions")
test_that("get_taxa() sites object", {
  skip_on_cran()
  abies <- get_taxa(1)
  testthat::expect_is(abies, "sites")
  abies_df <- abies %>% get_downloads() %>% taxa() %>% suppressWarnings()
  testthat::expect_true(any(grepl("Abies", abies_df$variablename)))
  abies <- get_taxa(taxonname = 'abies')
  testthat::expect_is(abies, "sites")
  abies_df <- abies %>% get_downloads() %>% taxa() %>% suppressWarnings()
  testthat::expect_true(any(grepl("Abies", abies_df$variablename)))
})

Try the neotoma2 package in your browser

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

neotoma2 documentation built on Dec. 6, 2025, 5:07 p.m.