Description Usage Arguments Value See Also Examples
Builds mask(s) based on a user-specified threshold for a single variable (e.g., mean precipitation or temperature). Grid cells greater than or equal to threshold value are reclassified as 1, values less than the threshold as 0. May be applied to a stack of grids (e.g., multi-date climate layers).
1 | mask_grids(climate.stack, threshold, filename = "", ...)
|
climate.stack |
Raster* object. Each layer corresponds to a different temporal window (e.g., month) for a single climate variable. Object may be single or multi-layer. |
threshold |
Numeric. Threshold value (lower-bound, inclusive) for a single climate variable. |
filename |
Character. Optional output root filename passed to
|
... |
Other arguments passed to |
RasterBrick. One output mask layer for each input data layer. If filename is specified, output file format is GeoTiff with unsigned integer data type.
intersect_masks, reclassify.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Climate data for North America to use in this example
data(prec_NA) # mean monthly precipitation (mm)
data(temp_NA) # mean monthly temperature (deg. C)
# Mask grid cells that meet minimum monthly precipitation values (>= 25 mm)
# for vegetation growth
precip_mask <- mask_grids(prec_NA, 25)
# Mask grid cells that meet min. monthly growing season temperature (>= 5 deg. C)
GS_temp_mask <- mask_grids(temp_NA, 5)
# Mask grid cells that meet min. monthly C4 temperature (>= 22 deg. C)
C4_temp_mask <- mask_grids(temp_NA, 22)
# Plot monthly growing season temperature masks
plot(GS_temp_mask)
# Plot C4 temperature mask for July only
plot(C4_temp_mask[[7]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.