movingwindow

0th

Percentile

Simple moving window function.

Very simple function to apply a kernel to a matrix across a moving window.

Keywords
stats
Usage
movingwindow(x, kernel, na.rm=TRUE)
Arguments
x

A matrix.

kernel

The kernel to be applied to the matrix, for example a Sobel kernel.

na.rm

NA handling option to be passed to sum(). If TRUE, NA will be returned if any value under the kernel is NA or NaN, otherwise NA values will be omitted.

Details

This function is used in the calculation of slope and aspect by slopeasp().

Value

Returns the transformed matrix.

Note

Should be rewritten in C for greater efficiency.

See Also

slopeasp

Aliases
  • movingwindow
Examples
# NOT RUN {
	data(dem)
	dem.smoothed <- movingwindow(dem, matrix(c(1,1,1,1,0,1,1,1,1), 3, 3)/8)

	par(mfrow=c(1,2))
	image(dem)
	image(dem.smoothed)
# }
Documentation reproduced from package landsat, version 1.1.0, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.