Learn R Programming

velox (version 0.2.0)

VeloxRaster_meanFocal: Mean focal

Description

Applies a mean filter with weights matrix weights to a VeloxRaster.

Arguments

weights

A numeric matrix of weights. Both dimensions must be uneven.

bands

Numeric vector indicating bands where filter is applied.

Value

Void.

Details

Padding is currently not implemented.

Examples

Run this code
# NOT RUN {
## Make VeloxRaster with two bands
mat1 <- matrix(1:100, 10, 10)
mat2 <- matrix(100:1, 10, 10)
vx <- velox(list(mat1, mat2), extent=c(0,1,0,1), res=c(0.1,0.1),
            crs="+proj=longlat +datum=WGS84 +no_defs")
## Mean focal
weights <- matrix(1, 5, 5)
vx$meanFocal(weights=weights, bands=c(1,2))

# }

Run the code above in your browser using DataLab