get_fire_danger_levels: get_fire_danger_levels

Description Usage Arguments Value Examples

View source: R/get_fire_danger_levels.R

Description

This function calculates the danger levels (VeryLow-Low-Moderate-High-VeryHigh-Extreme) for a given country.

Usage

1
get_fire_danger_levels(fire_index, ndays = 4)

Arguments

fire_index

RasterBrick containing the fire index to calculate the thresholds for. Please note that names(fire_index) should contain dates.

ndays

Number of days per year in which a fire is expected to occur. By default this is 4 days.

Value

A numeric vector listing the thresholds.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 

  # Generate dummy brick
  set.seed(0)
  r <- raster(nrows = 2, ncols = 2,
              xmn = 0, xmx = 360, ymn = -90, ymx = 90, vals = 30)
  # Simulate a long reanalysis record
  b <- raster::brick(lapply(1:(365 * 3),
       function(i) raster::setValues(r, runif(n = raster::ncell(r),
                                              min = 0, max = 100))))
  names(b) <- seq.Date(from = as.Date("1993-01-01"),
                       to = as.Date("1995-12-31"),
                       by = "day")
  # Generate danger levels
  get_fire_danger_levels(fire_index = b)


## End(Not run)

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