clamp time-series datat that are S shaped. The value in layers before the minimum value in a cell can be set to that minimum value, and the value in layers after the maximum value for a cell can be set to that maximum value.
## S4 method for signature 'SpatRaster'clamp_ts(x, min=FALSE, max=TRUE, filename="",...)
Arguments
x: SpatRaster
min: logical. If TRUE the time-series is clamped to the minimum value
max: logical. If TRUE the time-series is clamped to the maximum value
filename: character. Output filename
...: additional arguments for writing files as in writeRaster