Skip to contents

Function to run the feature approach

Usage

splnr_climate_featureApproach(
  features,
  metric,
  targets,
  direction,
  percentile = 35,
  refugiaTarget = 0.3
)

Arguments

features

feature sfobject

metric

climate metric sf object with 'metric' as the column name of the metric values per planning unit.

targets

data.framewith list of features under "feature" column and their corresponding targets under "target" column

direction

If direction = 1, metric values are from low (least climate-smart) to high (most climate-smart). If direction = -1, metric values are from high (least climate-smart) to low (most climate-smart).

percentile

cut-off threshold for determining whether an area is a climate priority area or not (e.g., lower 35th percentile of warming or upper 65th percentile of acidification). Note that the percentile here is the lower limit of the threshold.

refugiaTarget

target assigned to climate-smart areas

Value

A list with two components: 1. is the data frame passed to prioritizr when creating a conservation problem containing the binary information per planning unit per feature. 2. are the targets for the features in the conservation problem when the CPA approach is used.

Examples

Features <- dat_species_bin

targets <- Features %>%
  sf::st_drop_geometry() %>%
  colnames() %>%
  data.frame() %>%
  setNames(c("feature")) %>%
  dplyr::mutate(target = 0.3)

Feature_Approach <- splnr_climate_featureApproach(
  features = dat_species_bin,
  metric = dat_clim,
  targets = targets,
  direction = 1
)
#> [1] "Higher values mean more climate-smart areas."
out_sf <- Feature_Approach$Features
targets <- Feature_Approach$Targets