get_wecoma {comat}R Documentation

Create a weighted co-occurrence matrix (wecoma)

Description

Create a weighted co-occurrence matrix (wecoma)

Usage

get_wecoma(x, w, neighbourhood = 4, fun = "mean",
  na_action = "replace")

Arguments

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".

Value

A weighted co-occurrence matrix

Examples

library(comat)
library(raster)
data(x, package = "comat")
data(w, package = "comat")
plot(x)
plot(w)

wom = get_wecoma(x, w)
wom


[Package comat version 0.3.0 Index]