These functions use the median and other quantiles to describe the difference between a grid value and its neighborhood. They are designed for use with focal.function()
.
# S3 method for median
resid(x)# S3 method for minmedmax
resid(x)
# S3 method for quantile
resid(x, probs)
# S3 method for quartiles
resid(x)
If x
is provided, a numeric vector of length 1 (resid.median
), 3 (resid.minmedmax
and resid.quartiles
), or length(probs)
(resid.quantile
).
If x
is missing, a character vector of same length giving suggested variable (or file) names, such as "rmed"
. See focal.function()
for details.
a square matrix with the grid data from the moving window, possibly containing NA
values
numeric vector of probabilities in [0,1] to be passed to quantile()
These functions are designed for being called by focal.function()
, which repeatedly passes the contents of a square or circular moving window to these functions.
The resid.median
function rests the value of the central grid cell from the median of the whole moving window. Thus, in terms of topography, a positive residual median indicates that this grid cell stands out compared to its surroundings. resid.quantile
gives more flexibility in designing such residual attributes.
focal.function()
, quantile()
, median()
, centervalue()