tests/testthat/test-08-AttributeSpace.R

context("08-AttributeSpace")

test_that("AttributeSpace generator function", {
  # create object
  pu_coords <- suppressWarnings(sf::st_coordinates(sf::st_centroid(cs_pus)))
  x <- AttributeSpace(
    planning.unit.points = PlanningUnitPoints(
      pu_coords,
      seq_len(nrow(cs_pus))
    ),
    demand.points = make.DemandPoints(
      points = randomPoints(cs_spp[[1]], n = 100, prob = TRUE)
    ),
    species = 1L
  )
  # checks are internal
  suppressMessages(print(x))
  expect_true(methods::validObject(x, test = FALSE))
})

Try the raptr package in your browser

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

raptr documentation built on March 31, 2023, 9:46 p.m.