tests/testthat/test-data.R

test_that("function load.data works", {

  # applying the function
  data <- divraster::load.data()

  # testing
  expect_equal(length(data), 4)
  expect_s4_class(data$ref, "SpatRaster")
  expect_s4_class(data$fut, "SpatRaster")
  expect_s3_class(data$traits, "data.frame")
  expect_s3_class(data$tree, "phylo")
})

Try the divraster package in your browser

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

divraster documentation built on Oct. 11, 2023, 1:08 a.m.