raster (version 1.1.7)

focalValues: Extract focal values

Description

Extract focal values for a single row of a RasterLayer

Usage

focalValues(x, ...)

Arguments

x
RasterLayer object
...
Additional arguments. See Details

Value

  • A two column matrix. The first column has the column numbers, the second has the focal values.

Details

Additional arguments that can be suplied to this function: 1) r. row number (this is a required argument). 2) ngb. The neighborhood to consider. Either a single integer or a vector of two integers. Default is 3.

See Also

cellValues, xyValues, polygonValues, focal

Examples

Run this code
x <- raster(nrow=10, ncol=10)
x[] <- 1:ncell(x)
focalValues(x, r=5)

Run the code above in your browser using DataCamp Workspace