tests/testthat/test-taxonTree.R

test_that("taxonTree works", {

  skip_if_not_installed("data.tree")

  tf <- tempfile()
  sink(file = tf)
  x <- taxonTree(c("hapludults", "hapludalfs"))
  expect_true(inherits(x, 'SoilTaxonNode'))

  x <- taxonTree(
    "alfisols",
    root = "Alfisols",
    level = c("suborder", "greatgroup"),
    verbose = FALSE
  )
  expect_true(inherits(x, 'SoilTaxonNode'))

  x <- taxonTree("durixeralfs",
                 special.chars = c("\u251c",
                                   "\u2514",
                                   "\u2500 "))
  sink()
  expect_true(inherits(x, 'SoilTaxonNode'))
  unlink(tf)
})

Try the SoilTaxonomy package in your browser

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

SoilTaxonomy documentation built on Nov. 17, 2023, 1:07 a.m.