rasterLocalMoments: Local moments for an in memory raster image

Description Usage Arguments Value Examples

View source: R/rasterLocalMoments.R

Description

rasterLocalMoments finds the local moments within the weighted neighborhood of W.

Usage

1
rasterLocalMoments(r, WMu, WVar = WMu, moments = 2)

Arguments

r

An in memory raster image.

WMu

A matrix of weights. The mean kernel will be applied to each pixel in r. Dimensions must be non-zero and odd. Only non-missing neighbors are used in the mean.

WVar

A matrix of weights. The variance kernel will be applied at each centroid. Dimensions must be non-zero and odd. Only non-missing neighbors are used in the variance. The dimensions of WVar must match WMu.

moments

The number of moments to calculate. The local spatial mean will be calculated when moments=1. The local spatial mean and variance wil be calculated when moments=2. Currently no higher moments are supported.

Value

A list of in memory raster images, one list element for each moment.

Examples

1
2
3
r <- raster::raster( matrix(rnorm(36),6,6)) 
W <- matrix(1,3,3)
rLocalMoments <- rasterLocalMoments(r,W)

rasterKernelEstimates documentation built on Sept. 21, 2021, 9:07 a.m.