mask_climate: Generate Climate Masks Based on Two Parameters

Description Usage Arguments Value See Also Examples

Description

Generates climate masks based on two climate variables, typically temperature and precipitation. Grid cells that satisfy both criteria are reclassified as 1; else, grid cells are reclassified as 0. Climate threshold values are lower bound inclusive.

Usage

1
2
mask_climate(temp.stack, temp.threshold, precip.stack, precip.threshold,
  filename = "", ...)

Arguments

temp.stack

Raster* object. Each layer corresponds to a different temporal window (e.g., month) for a temperature climate variable. Object may be single or multi-layer.

temp.threshold

Numeric. Threshold value (lower-bound inclusive) for temperature variable.

precip.stack

Raster* object. Each layer corresponds to a different temporal window (e.g., month) for a precipitation climate variable. Object may be single or multi-layer.

precip.threshold

Numeric. Threshold value (lower-bound inclusive) for precipitation variable.

filename

Character. Optional output root filename passed to writeRaster, default output file type is GeoTiff. If not specified, output is written to a temporary file.

...

Other arguments passed to writeRaster.

Value

RasterBrick. One output mask layer for each input layer. If filename is specified, output file format is GeoTiff with unsigned integer data type.

See Also

mask_grids, intersect_masks, overlay.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Load data for example
data(temp_NA)    # mean monthly temperature (deg. C)
data(prec_NA)  # mean monthly precipitation (mm)

# Specify Growing Season (GS) thresholds
GS_temp <- 5     # mean monthly temperature >= 5 deg. C
GS_prec <- 25    # mean monthly precipitation >= 25 mm

# Generate stack of monthly growing season masks
GS_masks <- mask_climate(temp_NA, GS_temp, prec_NA, GS_prec)

# Plot monthly growing-season masks
plot(GS_masks)

rebeccalpowell/grassmapr documentation built on June 20, 2019, 8:07 p.m.