Run the required spatial analysis to create the spat_df input for calc_vulnerability and clip the range polygon to the appropriate scales.

analyze_spatial(
  range_poly,
  scale_poly,
  clim_vars_lst,
  non_breed_poly = NULL,
  ptn_poly = NULL,
  hs_rast = NULL,
  hs_rcl = NULL,
  gain_mod = 1,
  scenario_names = "Scenario 1"
)

Arguments

range_poly

an sf polygon object giving the species range.

scale_poly

an sf polygon object giving the area of the assessment

clim_vars_lst

a list of climate data, the result of get_clim_vars

non_breed_poly

Optional. An sf polygon object giving the species range in the non-breeding season.

ptn_poly

Optional. An sf polygon object giving the locations that are considered part of the physiological thermal niche (See NatureServe Guidelines for definition).

hs_rast

Optional. A SpatRaster object with results from a model of the change in the species' range caused by climate change. To supply different results for each scenario use a raster with multiple layers and ensure that the order of the layers matches the order of scenario_names.

hs_rcl

a matrix used to classify hs_rast into 0: not suitable, 1: lost, 2: maintained, 3: gained. See classify for details on the matrix format.

gain_mod

a number between 0 and 1 that can be used to down-weight gains in the modeled range change under climate change

scenario_names

character vector with names that identify multiple future climate scenarios.

Value

a list with elements: spat_table the results of the spatial analysis, range_poly_assess the range polygon clipped to the assessment area, and range_poly_clim the range polygon clipped to the extent of the climate data.

spat_table contains the following columns:

scenario_name

Name identifying the scenario

MAT_#

The percentage of the species' range that is exposed to each class of change in mean annual temperature between the historical normal and predicted climate. Class 1 has the highest exposure and Class 6 the lowest

CMD_#

The percentage of the species' range that is exposed to each class of change in climate moisture deficit between the historical normal and predicted climate. Class 1 has the highest exposure and Class 6 the lowest

CCEI_#

The percentage of the species' non-breeding range that falls into each climate change exposure index class. Class 4 indicates high exposure while Class 1 indicates low exposure

perc_non_breed_not_over_ccei

The precentage of the non-breeding range that does not overlap with the CCEI raster data

HTN_#

The percentage of the species' range that is exposed to each class of variation between the historical coldest and warmest monts. Class 1 has the smallest variation and Class 4 is the largest

PTN

The percentage of the species' range that falls into cool or cold environments that may be lost or reduced in the assessment area as a result of climate change

MAP_max/min

The maximum and minimum historical mean annual precipitation in the species' range

range_change

The projected decrease in range size as a percentage of current range size. Negative numbers indicate an increase in range size

range_overlap

The percentage of the current range that is projected to remain in the future range.

range_size

The area of the species' range in m2

Details

The range polygon will be clipped to the area overlapping the scale_poly and also to the area overlapping the extent of the climate data polygon. The range within the assessment area is used to calculate all results except the historical thermal and hydrological niches for which the range within the extent of the climate data is used.

Examples


base_pth <- system.file("extdata", package = "ccviR")

# scenario names
scn_nms <- c("RCP 4.5", "RCP 8.5")

clim_vars <- get_clim_vars(file.path(base_pth, "clim_files/processed"),
                           scenario_names = scn_nms)

spat_res <- analyze_spatial(
  range_poly = sf::read_sf(file.path(base_pth, "rng_poly.shp"), agr = "constant"),
  scale_poly = sf::read_sf(file.path(base_pth, "assess_poly.shp"), agr = "constant"),
  clim_vars_lst = clim_vars,
  hs_rast = terra::rast(c(file.path(base_pth, "rng_chg_45.tif"),
                          file.path(base_pth, "rng_chg_85.tif"))),
  hs_rcl = matrix(c(-1, 0, 1, 1, 2, 3), ncol = 2),
  scenario_names = scn_nms
)
#> performing spatial analysis
#> Warning: More than 10% of the range change raster does not match the expected values.
#> Is the classification table correct?