tests/testthat/test-data.R

test_that("forageLIBS has the documented structure", {
  data(forageLIBS, package = "specProc", envir = environment())
  expect_s3_class(forageLIBS, "tbl_df")
  expect_equal(dim(forageLIBS), c(368L, 7166L))
  expect_equal(names(forageLIBS)[1:14], c("Measurement", "Sample", "Ca", "Cl", "Cu", "Fe", "Mg",
                                          "Mn", "Mo", "P", "K", "Na", "S", "Zn"))
  expect_equal(length(unique(forageLIBS$Sample)), 365)
  expect_false(anyNA(as.numeric(names(forageLIBS)[-(1:14)])))
})

Try the specProc package in your browser

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

specProc documentation built on Nov. 20, 2026, 5:11 p.m.