tests/testthat/test-rcpp_ccl.R

mat8 <- matrix(c(NA, 1L, NA, NA, 1L, 1L, 1L, NA), 4, 2)
mat4 <- matrix(c(NA, 1L, NA, NA, 1L, 1L, 1L, NA), 4, 2)

rcpp_ccl(mat4, 4)
rcpp_ccl(mat8, 8)

test_that("rcpp_ccl patch labelling is correct", {
    expect_equal(length(get_unique_values(mat4, simplify = TRUE)), 1)
    expect_equal(length(get_unique_values(mat8, simplify = TRUE)), 1)
})

Try the landscapemetrics package in your browser

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

landscapemetrics documentation built on Oct. 3, 2023, 5:06 p.m.