cond_permute_nb: Conditional permutation of neighbors

View source: R/utils.R

cond_permute_nbR Documentation

Conditional permutation of neighbors

Description

Creates a conditional permutation of neighbors list holding i fixed and shuffling it's neighbors.

Usage

cond_permute_nb(nb, seed = NULL)

Arguments

nb

a neighbor list.

seed

default null. A value to pass to set.seed() for reproducibility.

Value

A list of class nb where each element contains a random sample of neighbors excluding the observed region.

Examples

nb <- st_contiguity(guerry)
nb[1:5]
# conditionally permute neighbors
perm_nb <- cond_permute_nb(nb)
perm_nb[1:5]

JosiahParry/sfdep documentation built on Sept. 7, 2024, 6:15 a.m.