Learn R Programming

SurfRough (version 0.0.1.2)

iqrST: iqrST: interquartile range in a moving window

Description

A function to compute IQR with r method type 7 in a search window. It uses the implemented rcpp version that is many times faster that using focal with IQR() base R function. It provides the same result as ArcGis Pro.It is intended for computing roughness indices expressed as a robust (differently from standard deviation) estimate of dispersion of local surface parameters (e.g., slope, profile curvature, residual surface, etc.).

Usage

iqrST(x, w = 5, ...)

Value

the IQR of the selected property in the search window (same units of the input)

Arguments

x

A DEM/image as a SpatRaster

w

Search window (e.g., kernelCircular(3)), default 5x5 window

...

for further use

References

Trevisani, S., Guth, P.L., 2025. Surface Roughness in Geomorphometry: From Basic Metrics Toward a Coherent Framework. Remote Sensing 17, tools:::Rd_expr_doi("doi:10.3390/rs17233864").

Examples

Run this code
dem= rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep=""))
# iqr of slope in degrees
slope=terrain(dem, v="slope")
w=KernelCircular(3)
w
iqrSlope=iqrST(slope,w=w)
plot(iqrSlope)

Run the code above in your browser using DataLab