# Calculates standard deviation of bathymetry (a measure of rugosity) adjusted for slope

Source:`R/AdjSD.R`

`AdjSD.Rd`

Calculates standard deviation of bathymetry (a measure of rugosity). Using a sliding rectangular window a plane is fit to the data and the standard deviation of the residuals is calculated (Ilich et al., 2023)

## Arguments

- r
DTM as a SpatRaster or RasterLayer in a projected coordinate system where map units match elevation/depth units

- 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.

- na.rm
A logical indicating whether or not to remove NA values before calculations

- 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