Create a co-occurrence matrix (coma)
get_coma(x, neighbourhood = 4, classes = NULL)
x | A matrix with categories |
---|---|
neighbourhood | The number of directions in which cell adjacencies are considered as neighbours: 4 (rook's case) or 8 (queen's case). The default is 4. |
classes | A vector or a list with the values of selected classes from the |
A co-occurrence matrix
#> 1 2 3 #> 1 4 1 3 #> 2 1 2 2 #> 3 3 2 6#> 1 3 #> 1 4 3 #> 3 3 6#> 0 1 2 3 <NA> #> 0 0 0 0 0 0 #> 1 0 2 0 2 1 #> 2 0 0 2 1 2 #> 3 0 2 1 0 3 #> <NA> 0 1 2 3 2