Calculates Roughness Index-Elevation. This is the standard deviation of residual topography in a focal window where residual topography is calculated as the focal pixel minus the focal mean.
Arguments
- r
DTM as a SpatRaster or RasterLayer
- w
A vector of length 2 specifying the dimensions of the rectangular window to use where the first number is the number of rows and the second number is the number of columns. Window size must be an odd number. Default is 3x3.
- na.rm
A logical indicating whether or not to remove NA values before calculation of SD
- include_scale
logical indicating whether to append window size to the layer names (default = FALSE)
- filename
character Output filename.
- overwrite
logical. If TRUE, filename is overwritten (default is FALSE).
- wopt
list with named options for writing files as in writeRaster
Details
Note the original paper by Cavalli et al (2008) uses a fixed 5x5 window and uses 25 as the denominator indicating use of the population standard deviation. This implementation provides a flexible window size and istead calculates the sample standard deviation which uses a denominator of n-1.