trim(x, ...)
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.x
is a RasterLayer, the following additional arguments can be passed, to replace default values for this function
padding
Integer. Number of outer rows/columns with NA values to keep; default=0
filename
Output filename. Default = ''
format
Character. Output file type. See writeRaster
datatype
Character. Output data type; can be 'INT', 'FLT', or a complete datatype description, see dataType
overwrite
Logical. If TRUE
, "filename" will be overwritten if it exists
progress
Character. Valid values are "text", "tcltk", "windows" (on that platform only) and ""
}r1 <- raster(ncol=36,nrow=18)
r1[309:310] <- 1:2
r1[353:355] <- 3:5
r1[400] <- 6
s <- trim(r1)
trim("hi folks ")
Run the code above in your browser using DataLab