standardFocalWindow: create squared matrix for use with raster::focal

View source: R/standardFocalWindow.R

standardFocalWindowR Documentation

create squared matrix for use with raster::focal

Description

this function produces a square matrix for use with focal. User can set the size (must be odd) and center value (i.e. 0 or 1). All non-center values are set to 1.

Usage

standardFocalWindow(n = 3, center = 0L)

Arguments

n

size (i.e. ncol and nrow)

center

the value (weight) for the center of the window. Defaults to 0

Value

A matrix of 1s with n columns and n rows and a center value of center

Author(s)

Tim Appelhans

Examples

standardFocalWindow() # 3 by 3 matrix
standardFocalWindow(n = 5, center = 1)


environmentalinformatics-marburg/Rsenal documentation built on July 28, 2023, 6:09 a.m.