classify_index: classify_index

Description Usage Arguments Value Examples

View source: R/classify_index.R

Description

This function classifies a fire danger index based on user defined danger thresholds. If index is one of GEFF's indices (fwi, ffmc, dmc, dc, isi, bui), the user does not need to specify thresholds and labels. Default thresholds and labels are those defined by JRC for Europe: https://effis.jrc.ec.europa.eu/about-effis/technical-background/fire-danger-forecast/ For instance if index = "fwi", default thresholds and labels are: very Low = 0-5.2, low = 5.2-11.2, moderate = 11.2-21.3, high = 21.3-38.0, very high = 38-50.0, extreme = > 50. However, if threshold != NULL, the default values will be overwritten by the custom values.

Usage

1
classify_index(r, index = NULL, thresholds = NULL, labels = NULL)

Arguments

r

is the Raster* object to classify.

index

this is the code of the fire danger index.

thresholds

numeric vector containing 5 thresholds.

labels

string of characters to be used as labels

Value

The function returns a Raster* object of the same dimensions of r but the values are categorical from 1 to 6 (corresponding to very low, low, moderate, high, very high and extreme danger, respectively). Some cells may contain NAs, this happens typically over the sea.

Examples

1
2
3
4
5
6
7
8
## Not run: 
  r <- readRDS(system.file("extdata", "RISICO_raster.rds", package = "caliver"))
  x <- classify_index(r, index = "fwi")

  # This can be plotted using rasterVis::levelplot()
  rasterVis::levelplot(x)

## End(Not run)

caliver documentation built on Feb. 19, 2021, 5:07 p.m.