Generate a suite of conservation footprint 'solutions' based on feature suitability values and a list of targets for all features.
Usage
optimTFE(
targets = NULL,
suitability = NULL,
subregions = NULL,
populations = NULL,
incompatibility = NULL,
min_spp_suit_score = 0,
rand_tolerance = 5,
max_spp_selected = -1,
single_pu_pop = TRUE,
n = 100,
cores = NULL,
batch_size = NULL,
max_batch_size = 1000,
seed = NULL,
out_dir = ".",
run_id = "optimTFE",
output_csv = TRUE,
return_df = FALSE,
dry_run = FALSE,
force_overwrite = FALSE
)Arguments
- targets
species targets file - path to a csv file or a pre-loaded data frame or matrix. If loading from file, the first column should contain the species names, otherwise species names should be included as row names. The column direclty following the species names should contain the total targets for each species. Additional columns should specify the (optional) subregion targets, with values specifying the minimum targets required in each subregion.
- suitability
species suitability matrix - path to a csv/tsv file or a pre-loaded data frame or matrix. The first column must be the planning unit id / number and following columns are species. If using a preloaded matrix or data frame, unit ids should be set as row names, not in the first column. Values indicate the suitability scores for each species / taxon in each planning unit.
- subregions
(optional) path to a csv/tsv file or a pre-loaded data frame or matrix defining sub-regions within the set of planning units. Must include 1 row for each planning unit with binary values indicating the sub-region membership of each planning unit. Sub-region column names must match those provided in the `targets` input.
- populations
(optional) path to a csv/tsv file or a pre-loaded data frame or matrix of delineated populations. When loading from file data can be in long or wide format. Long format should consist of 3 columns, unit_id, species, and population. Wide format should have one column per species and one row per unit_id. If providing a data frame or matrix directly, only wide formats is accepted and unit ids should be set as rownames, not as a column.
- incompatibility
(optional) path to a csv/tsv file or a pre-loaded data frame or matrix specifying species that cannot share the same planning unit. Must be a symmetric matrix with species names as row and column names, where a value of 1 indicates the species are incompatible (cannot be in the same unit).
- min_spp_suit_score
minimum suitability score for a species to be considered in a location.
- rand_tolerance
the range of species richness, from maximum, to consider for selection at each iteration (default = 5)
- max_spp_selected
maximum number of species to select in each location (default = -1) to reduce 'species packing' within units. This parameter could cause species to be unable to meet targets. Use -1 for no limit.
- single_pu_pop
should only one location (ie unit) be selected per delineated population (default = TRUE). Only applies if a known population file (`populations`) is provided.
- n
number of solutions to generate (default = 100)
- cores
number of cores to use (default = NULL, uses all available - 1)
- batch_size
when parallel processing is used, this parameter can be used to process solution in batches for improved efficiency (default = NULL). If not provided (NULL), batch size will be calculated automatically.
- max_batch_size
limit batch size for parallel processing (default = 1000). Smaller values will allow the progress bar to update more frequently, but at the cost of more disk writes.
- seed
seed for reproducible output (optional)
- out_dir
location to write outputs (default = "."). If NULL, results will be returned as a data frame and temporary files will be used.
- run_id
prefix for output files (default = "optimTFE")
- output_csv
Should the solutions be compiled to a single csv file (default = TRUE)
- return_df
return all generated solutions as a data frame in the current R session (default = FALSE)
- dry_run
validate inpute without generating solutions (default = FALSE)
- force_overwrite
overwrite existing output files (default = FALSE)
Details
The function generates conservation footprints based on species/feature habitat suitability scores within planning units, and a target number of populations per species. A greedy algorithm iteratively selects planning units with the highest number of remaining species targets until all targets are met. To mitigate known pitfalls of richness-based selection at each iteration, stochasticity is introduced where one planning unit is randomly selected from a pool of planning units within a set number of targets of the maximum for that iteration. To maximize species suitability scores in selected units the probability of selection is weighted by the mean suitability scores of remaining targets. Constraints, such as hybridization, can be introduced to specifically prohibit the algorithm from selecting the same planning unit for two taxa. This process is then repeated to generate many spatially efficient solutions that meet all targets for each species.