hexconvol: Compute convolution over neighbours of elements of a...

Description Usage Arguments Value

View source: R/hexconvol.R

Description

The result of this function is a hexmatrix of dimensions equal to m with values computed as a weighted sum of value at the given position and in the neighbourhood of that position. The weights are given by the probs argument.

Usage

1
hexconvol(m, probs = 1)

Arguments

m

a numeric hexmatrix

probs

a vector of length 7 with six weights corresponding to the neighbours clock-wisely from top-left. The 7th value corresponds to the weight of a value at the "current" position. Precisely, the weights are understood as follows:

  1. probs[1] for top-left,

  2. probs[2] for top-right,

  3. probs[3] for right,

  4. probs[4] for bottom-right,

  5. probs[5] for bottom-left,

  6. probs[6] for left neighbour's weight of the "current" position,

  7. probs[7] for the "current" value's weight.

Value

a hexmatrix of dimensions equal to m with values computed as a convolution over the neighbours of m's values


beerda/hexmatrix documentation built on May 2, 2021, 4:15 a.m.