powered by
Creates a conditional permutation of neighbors list holding i fixed and shuffling it's neighbors.
cond_permute_nb(nb, seed = NULL)
A list of class nb where each element contains a random sample of neighbors excluding the observed region.
nb
a neighbor list.
default null. A value to pass to set.seed() for reproducibility.
set.seed()
nb <- st_contiguity(guerry) nb[1:5] # conditionally permute neighbors perm_nb <- cond_permute_nb(nb) perm_nb[1:5]
Run the code above in your browser using DataLab