Description Usage Arguments Value See Also Examples
Create a new Raster* object that has the same values as x
, except for the cells that are NA
(or other maskvalue
) in a 'mask'. These cells become NA
(or other updatevalue
). The mask can be either another Raster* object of the same extent and resolution, or a Spatial* object (e.g. SpatialPolygons) in which case all cells that are not covered by the Spatial object are set to updatevalue
. You can use inverse=TRUE
to set the cells that are not NA
(or other maskvalue
) in the mask, or not covered by the Spatial* object, to NA
(or other updatvalue
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## S4 method for signature 'RasterLayer,RasterLayer'
mask(x, mask, filename="", inverse=FALSE,
maskvalue=NA, updatevalue=NA, updateNA=FALSE, ...)
## S4 method for signature 'RasterStackBrick,RasterLayer'
mask(x, mask, filename="", inverse=FALSE,
maskvalue=NA, updatevalue=NA, updateNA=FALSE, ...)
## S4 method for signature 'RasterLayer,RasterStackBrick'
mask(x, mask, filename="", inverse=FALSE,
maskvalue=NA, updatevalue=NA, updateNA=FALSE, ...)
## S4 method for signature 'RasterStackBrick,RasterStackBrick'
mask(x, mask, filename="", inverse=FALSE,
maskvalue=NA, updatevalue=NA, updateNA=FALSE, ...)
## S4 method for signature 'Raster,Spatial'
mask(x, mask, filename="", inverse=FALSE,
updatevalue=NA, updateNA=FALSE, ...)
|
x |
Raster* object |
mask |
Raster* object or a Spatial* object |
filename |
character. Optional output filename |
inverse |
logical. If |
maskvalue |
numeric. The value in |
updatevalue |
numeric. The value that cells of |
updateNA |
logical. If |
... |
additional arguments as in |
Raster* object
1 2 3 4 5 6 7 8 9 |
Loading required package: sp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.