Description Usage Arguments Examples
Create matrix of lists, where each one contains list of neighbour field coordinates
1 2 | neighbour_idx_matrix(mat, mask = NULL, diagonal = TRUE,
random.select = NULL)
|
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 |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.