tests/testthat/test-metrics.R

x = create_realizations(race_raster, n = 5)
w = create_densities(x, race_raster, window_size = 100)
df = calculate_metrics(x, w, neighbourhood = 4, fun = "mean")
df2 = calculate_metrics(x, w, neighbourhood = 4, fun = "mean", size = 100)

test_that("calculate_metrics output structure is stable", {
  expect_equal(dim(df), c(5, 7))
  expect_equal(dim(df2), c(5, 7))
})

Try the raceland package in your browser

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

raceland documentation built on April 14, 2023, 5:09 p.m.