get_wecoma {comat} | R Documentation |
Create a weighted co-occurrence matrix (wecoma)
get_wecoma(x, w, neighbourhood = 4, fun = "mean", na_action = "replace")
x |
A RasterLayer with categories |
w |
A RasterLayer with weights |
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. |
fun |
"mean", "geometric_mean", or "focal". The default is "mean". |
na_action |
"replace", "omit", or "keep". The default is "replace". |
A weighted co-occurrence matrix
library(comat) library(raster) data(x, package = "comat") data(w, package = "comat") plot(x) plot(w) wom = get_wecoma(x, w) wom