neighbour_idx_matrix: Create matrix of lists, where each one contains list of...

Description Usage Arguments Examples

View source: R/index.R

Description

Create matrix of lists, where each one contains list of neighbour field coordinates

Usage

1
2
neighbour_idx_matrix(mat, mask = NULL, diagonal = TRUE,
  random.select = NULL)

Arguments

mat

matrix

mask

logical matrix. Its dimensions must be identical with dimensions of mat

diagonal

logical. get diagonal neighbours

random.select

select one random neighbour

Examples

1
2
3
4
5
T <- TRUE; F <- FALSE
mat <- matrix(0, 3, 3)
mask <- m(T, T, F | T, F, T | F, F, T)
nimat <- neighbour_idx_matrix(mat, mask, diagonal = TRUE)
neighbour_idx_matrix(mat, mask, diagonal = TRUE, random.select = 1)

matricks documentation built on March 26, 2020, 6:22 p.m.