Skip to contents

For advanced users. fire_exp_validate() compares the proportion of exposure classes in a the study area to the proportion of exposure classes within burned areas. A random sample is taken to account for spatial autocorrelation.

Usage

fire_exp_validate(
  burnableexposure,
  fires,
  aoi,
  samplesize = 0.005,
  plot = FALSE
)

Arguments

burnableexposure

A SpatRaster of exposure, non-burnable cells should be removed using optional parameter in fire_exp().

fires

A SpatVector of observed fire perimeters

aoi

(Optional) A SpatVector that delineates an area of interest

samplesize

Proportion of area to sample. The default is 0.005 (0.5%)

plot

Boolean, when TRUE: returns a plot of expected and observed exposure class proportions within entire extent and sampled areas. The default is FALSE.

Value

table or plots

Examples


# read example hazard data ----------------------------------
filepath <- "extdata/hazard.tif"
haz <- terra::rast(system.file(filepath, package = "fireexposuR"))
# generate example non-burn data -----------------------------
filepath <- "extdata/builtsimpleexamplegeom.csv"
g <- read.csv(system.file(filepath, package = "fireexposuR"))
v <- terra::vect(as.matrix(g), "polygons", crs = haz)
nb <- terra::rasterize(v, haz)
# generate example fire polygons -----------------------------
pts <- terra::spatSample(terra::rescale(haz, 0.8), 30, as.points = TRUE)
fires <- terra::buffer(pts, 800)
# ----------------------------------------------------------
# PLEASE NOTE THIS RANDOMLY GENERATED DATA DOES NOT GIVE MEANINGFUL RESULTS
exp <- fire_exp(haz, nonburnable = nb)
fire_exp_validate(exp, fires)
#>    exposure  classexp     of    group      n       prop
#> 1         1       Low  Total Expected 319405 0.32615344
#> 2         2  Moderate  Total Expected 118204 0.12070143
#> 3         3      High  Total Expected 121840 0.12441426
#> 4         4 Very High  Total Expected 115882 0.11833037
#> 5         5   Extreme  Total Expected 303978 0.31040050
#> 6         1       Low  Total Observed   2427 0.34716064
#> 7         2  Moderate  Total Observed    666 0.09526534
#> 8         3      High  Total Observed    743 0.10627950
#> 9         4 Very High  Total Observed    713 0.10198827
#> 10        5   Extreme  Total Observed   2442 0.34930625
#> 11        1       Low Sample Expected   1598 0.32632224
#> 12        2  Moderate Sample Expected    615 0.12558709
#> 13        3      High Sample Expected    569 0.11619359
#> 14        4 Very High Sample Expected    609 0.12436185
#> 15        5   Extreme Sample Expected   1506 0.30753523
#> 16        1       Low Sample Observed     14 0.40000000
#> 17        2  Moderate Sample Observed      2 0.05714286
#> 18        3      High Sample Observed      7 0.20000000
#> 19        4 Very High Sample Observed      3 0.08571429
#> 20        5   Extreme Sample Observed      9 0.25714286
#' fire_exp_validate(exp, fires, plot = TRUE)