mask

0th

Percentile

mask

Create a new RasterLayer where all cells that are NA in mask are set to NA, and that has the same values as x in the other cells.

Keywords
methods, spatial
Usage
mask(x, mask, ...)
Arguments
x
A RasterLayer object
mask
A RasterLayer object
...
Additional arguments. See below, under Methods
Details

If no filename is specified, and the resulting RasterLayer is too large to hold in memory, it is saved to a temporary file. The following additional arguments can be passed, to replace default values for this function rll{ format Character. Output file type. See writeRaster datatype Character. Output data type. 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 "" }

Value

  • A new RasterLayer object, and in some cases the side effect of a new file on disk.

Methods

A full call to the mask method for a RasterLayer is: mask(x, mask, filename='', ... ) rll{ x a RasterLayer object mask a RasterLayer object filename character. output filename ... Additional arguments, see Details }

Aliases
  • mask
  • mask,RasterLayer,RasterLayer-method
Examples
r <- raster(ncol=10, nrow=10)
m <- raster(ncol=10, nrow=10)
r[] <- runif(ncell(r)) * 10
m[] <- runif(ncell(r))
m[m <0.5] <- NA
mr <- mask(r, m)
Documentation reproduced from package raster, version 1.0.0-1, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.