Create a weighted co-occurrence matrix (wecoma)
get_wecoma( x, w, neighbourhood = 4, classes = NULL, fun = "mean", na_action = "replace" )
A matrix with categories
A matrix with weights
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.
A vector or a list with the values of selected classes from the x object. It is used to calculate wecoma only for selected classes.
x
"mean", "geometric_mean", or "focal". The default is "mean".
"replace", "omit", or "keep". The default is "replace".
A weighted co-occurrence matrix
# NOT RUN { library(comat) data(raster_x, package = "comat") data(raster_w, package = "comat") wom = get_wecoma(raster_x, raster_w) wom get_wecoma(raster_x, raster_w, classes = list(c(1, 3))) # }
Run the code above in your browser using DataLab