na_mask | R Documentation |
Create a mask raster, retaining NA and setting all non-NA cells to 1. Input raster will be resampled if necessary, using "max" resampling (i.e. if any contributing cells are not NA, the new cell will be set to 1).
na_mask(infile, outfile, res, extent)
infile |
Character. File path to input raster file. |
outfile |
Character. Output raster file path. Directory will be created (recursively) if it doesn't exist. |
res |
Numeric. A vector of one or two numbers giving the desired output resolution. If missing, the input resolution will be used. If a single number is provided, it will be used for both horizontal and vertical resolution. |
extent |
One of of: a numeric vector giving the desired extent of the
output raster as |
A raster is written to outfile
, with NA cells transferred
from infile
and all other cells set to 1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.