Learn R Programming

SurfRough (version 0.0.1.2)

RRI: RRI: Radial Roughness index

Description

Modified TRI, based on increments of order 2 (reducing/removing slope dependence) and correcting for diagonal distance. RRI modifies TRI (topographic ruggedness index) using increments of order 2, symmetrical to the central pixel, so as to reduce/remove the effect of local slope. This version corrects for the diagonal distance using bilinear interpolation. It uses a 5x5 kernel, consequently 12 directional differences of order k=2 are used in the estimation. One could also use a 3x3 kernel using only the 4 differences centered on the central pixel but the metric would be very noisy (see RRIcore()). The input is the DEM/image (no need to detrend).

Usage

RRI(x, ...)

# S3 method for numeric RRI(x, ...)

# S3 method for SpatRaster RRI(x, ..., .method = c("rcpp", "r"))

Value

RRI (in the same units of input)

Arguments

x

A DEM/image as a SpatRaster or a vector of numeric values from a focal window in a DEM from which to compute the index

...

reserved for future use

.method

Either r or rcpp (fast batch processing using C++)

References

#' 1) Riley, S. J., S. D. DeGloria, and R. Elliott. 1999. A terrain ruggedness index that quantifies topographic heterogeneity. Intermountain Journal of Science 5:23. 2) Wilson, M.F.J., O'Connell, B., Brown, C., Guinan, J.C. & Grehan, A.J. 2007. Multiscale terrain analysis of multibeam bathymetry data for habitat mapping on the continental slope". Marine Geodesy, vol. 30, no. 1-2, pp. 3-35. 3) Trevisani S., Teza G., Guth P.L., 2023. Hacking the topographic ruggedness index. Geomorphology tools:::Rd_expr_doi("doi:10.1016/j.geomorph.2023.108838").

Examples

Run this code
library(terra)
dem= rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep=""))
w <- matrix(1, nrow=5, ncol=5)
roughRRI_v1=focal(dem, w=w, fun=RRI)
roughRRI_v2=RRI(dem)
plot(c(roughRRI_v1, roughRRI_v2))

Run the code above in your browser using DataLab