
Run the Percentile Climate-Smart Approach
Source:R/utils-climate.R
splnr_climate_percentileApproach.Rdsplnr_climate_percentileApproach() implements the Percentile Approach to
climate-smart conservation planning. This involves filtering features to
their most climate-resilient areas and adjusting their conservation targets
to account for this reduced feature distribution.
Arguments
- features
An
sfobject representing conservation features (e.g., species distribution data).- metric
An
sfobject containing climate metric information. It must have a column named 'metric' with the climate metric values per Planning Unit.- targets
A
data.framewith two columns:feature(character, listing the original feature names) andtarget(numeric, the initial conservation target for each feature as a proportion, e.g., 0.3).- direction
An integer specifying the direction of climate-smartness:
1: Higher metric values mean more climate-smart areas.-1: Lower metric values mean more climate-smart areas.
- percentile
A numeric value (0-100) representing the cutoff threshold for determining whether an area is a climate priority area or not. This is applied per feature to its distribution. Defaults to
35.
Value
A list with two components:
Features: Ansfobject containing the binary information per Planning Unit for each feature, now filtered to include only its climate-smart occurrences. This is ready to be passed toprioritizr.Targets: Adata.framewith the adjusted targets for the filtered features. This is also ready forprioritizr.
Details
This function orchestrates the steps for the Percentile Approach:
Preprocessing: It calls
splnr_climate_percentile_preprocess()to identify, for each feature, its occurrences within the most climate-resilientpercentileof its distribution based on a climate metric. This effectively "filters" the feature data to only include its climate-smart components.Target Assignment: It then calls
splnr_climate_percentile_assignTargets()to calculate and assign new targets for these filtered features. The targets are scaled up to ensure that the original conservation goals are still met, but specifically by selecting areas from the climate-smart portions of the features' distributions.
The output is a list containing the modified features (filtered to their
climate-smart occurrences) and their corresponding adjusted targets, ready
to be used in a prioritizr conservation problem.
Examples
if (FALSE) { # \dontrun{
# Assuming 'dat_species_bin' and 'dat_clim' are existing sf objects
# in your package.
# Define initial targets for species features.
initial_targets <- dat_species_bin %>%
sf::st_drop_geometry() %>%
colnames() %>%
data.frame() %>%
setNames(c("feature")) %>%
dplyr::mutate(target = 0.3)
# Run the Percentile Approach where higher climate metric values mean
# more climate-smart areas.
Percentile_Approach_result <- splnr_climate_percentileApproach(
features = dat_species_bin,
metric = dat_clim,
targets = initial_targets,
direction = 1, # Example: higher metric values are more climate-smart
percentile = 35
)
# Access the processed features and targets:
out_sf_percentile <- Percentile_Approach_result$Features
targets_percentile <- Percentile_Approach_result$Targets
print(head(out_sf_percentile))
print(head(targets_percentile))
} # }