tests/testthat/test-reduceSPC.R

test_that("reduceSPC() works", {
  data(sp4)
  depths(sp4) <- id ~ top + bottom
  
  sp4$texcl <- ssc_to_texcl(sp4$sand, sp4$clay)
  
  hzdesgnname(sp4) <- "name"
  hztexclname(sp4) <- "texcl"
  
  site(sp4)$newsite <- LETTERS[1:length(sp4)]
  
  x <- reduceSPC(sp4, c("newsite", "CF"))
  
  expect_true(
    all(horizonNames(x) %in% c("id", "top", "bottom", "hzID", "name", "texcl", "CF")) &&
    all(siteNames(x) %in% c("id", "newsite"))
  )
})

Try the aqp package in your browser

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

aqp documentation built on Sept. 8, 2023, 5:45 p.m.