Skip to contents

A regionalisation if a partition with all clusters being connected (there only have one connected component each), regarding to a contiguity relation.

Usage

checkRegionalisation(regionalisation, contiguity)

assertRegionalisation(
  regionalisation,
  contiguity,
  .var.name = checkmate::vname(regionalisation),
  add = NULL
)

testRegionalisation(regionalisation, contiguity)

Arguments

regionalisation

The argument to check.

contiguity

A contiguity matrix or a contiguity graph (igraph).

.var.name

Name of the checked object to print in assertions. Defaults to the heuristic implemented in checkmate::vname().

add

Collection to store assertion messages. See checkmate::AssertCollection.

Value

Please see checkmate::checkMatrix() help page (for instance) for further details about the difference between check_, test_ and assert_ functions results.

Details

Extension of the checkmate package.

See also

Examples

contiguity <- simple_grid(3L, 2L)$contiguity

regionalisation <- c(1L, 1L, 1L,
                     2L, 2L, 2L)

checkRegionalisation(regionalisation, contiguity) # TRUE
#> [1] TRUE

notRegionalisation <- c(1L, 2L, 1L,
                        1L, 2L, 1L)

checkRegionalisation(notRegionalisation, contiguity) # message
#> [1] "at least one cluster is not connected"