Create a new Raster* object where all cells that are NA in a 'mask' object are set to NA, and that has the same values as x in the other cells. Or use inverse=TRUE to set the cells that are not NA in the mask to NA.
Usage
mask(x, mask, ...)
Arguments
x
Raster* object
mask
Raster* object or a Spatial* object
...
Additional arguments. See under Methods
Value
A new Raster* object, and in some cases the side effect of a new file on disk.
Methods
The following additional arguments can be passed, to replace default values for this function
rll{
reverse Boolean. If TRUE, areas on mask that are _not_ NA are masked.
filename Character. output filename
format Character. Output file type. See writeRasterdatatype Character. Output data type. See dataTypeoverwrite Logical. If TRUE, "filename" will be overwritten if it exists
progress Character. "text", "window", or "" (the default, no progress bar)
}