trim.RdTrim (shrink) a SpatRaster by removing outer rows and columns that are NA or another value.
# S4 method for class 'SpatRaster'
trim(x, padding=0, value=NA, filename="", ...)SpatRaster
integer. Number of outer rows/columns to keep
numeric. The value of outer rows or columns that are to be removed
character. Output filename
additional arguments for writing files as in writeRaster
SpatRaster