Trim (shrink) a RasterLayer by removing outer rows and columns that have no data.
Or remove the whitespace before or after a string of characters.
Usage
trim(x, ...)
Arguments
x
A RasterLayer object or a character string
...
additional arguments. See Details.
Value
If x is a RasterLayer, a new RasterLayer object (in the R environment), and in some cases the side effect of a new file on disk.
A character string If x is a character string.
Details
If x is a RasterLayer, the following additional arguments can be passed, to replace default values for this function
rll{
padding Integer. Number of outer rows/columns with NA values to keep; default=0
filename Output filename. Default = ''
format Character. Output file type. See writeRasterdatatype Character. Output data type; can be 'INT', 'FLT', or a complete datatype description, see dataTypeoverwrite Logical. If TRUE, "filename" will be overwritten if it exists
progress Character. "text", "window", or "" (the default, no progress bar)
}