Get available marix indices

matrix_idx(mat, n.row = NULL, n.col = NULL, mask = NULL)

Arguments

mat

matrix

n.row

number of rows; default: NULL

n.col

number of columns; default: NULL

mask

logical matrix; default: NULL

Examples

T <- TRUE; F <- FALSE mat <- matrix(0, 3, 3) mask <- m(T, T, F | T, F, T | F, F, T) # All poss matrix_idx(mat)
#> [[1]] #> [1] 1 1 #> #> [[2]] #> [1] 2 1 #> #> [[3]] #> [1] 3 1 #> #> [[4]] #> [1] 1 2 #> #> [[5]] #> [1] 2 2 #> #> [[6]] #> [1] 3 2 #> #> [[7]] #> [1] 1 3 #> #> [[8]] #> [1] 2 3 #> #> [[9]] #> [1] 3 3 #>
matrix_idx(mat, mask = mask)
#> [[1]] #> [1] 1 1 #> #> [[2]] #> [1] 2 1 #> #> [[3]] #> [1] 1 2 #> #> [[4]] #> [1] 2 3 #> #> [[5]] #> [1] 3 3 #>
matrix_idx(mask = mask)
#> [[1]] #> [1] 1 1 #> #> [[2]] #> [1] 2 1 #> #> [[3]] #> [1] 1 2 #> #> [[4]] #> [1] 2 3 #> #> [[5]] #> [1] 3 3 #>