Skip to contents

Runs the gdrare pipeline for all restrictions. Returns the list of dataframes with joined original species data, summaries of thresholds, directions, and the parameter grid.

Usage

run_all_gdrare_combos(
  species_df,
  abundance_df = NULL,
  trait_cols = NULL,
  geo_methods = c("taxonomic", "range"),
  fun_methods = c("min_distance", "mean_distance"),
  abundances = c(TRUE, FALSE),
  threshold_sets = list(list(GR = 0.15, GL = 0.15, FR = 0.9, FL = 0.9, PR = 0.75, PL =
    0.75), list(GR = 0.15, GL = 0.15, FR = 0.75, FL = 0.75, PR = 0.75, PL = 0.75),
    list(GR = 0.15, GL = 0.15, FR = 0.9, FL = 0.9, PR = 0.9, PL = 0.9), list(GR = 0.15,
    GL = 0.15, FR = 0.9, FL = 0.9, PR = 0.75, PL = 0.75)),
  direction_sets = list(list(GR = "low", GL = "low", FR = "high", FL = "high", PR =
    "high", PL = "high"), list(GR = "low", GL = "low", FR = "high", FL = "high", PR =
    "high", PL = "high"), list(GR = "low", GL = "low", FR = "high", FL = "high", PR =
    "high", PL = "high"), list(GR = "low", GL = "low", FR = "high", FL = "high", PR =
    "high", PL = "high")),
  species_col = "species",
  use_internal_phylo = TRUE,
  internal_phylo_name = "ALLMB",
  k_means = FALSE,
  additional_dimensions = NULL,
  model = NULL,
  phylo = NULL,
  verbose = TRUE
)

Arguments

species_df

Data frame of species trait and metadata.

abundance_df

Data frame of site-by-species abundance data.

trait_cols

Character vector of trait column names to use.

geo_methods

Character vector of methods to use for regional geographic rarity. Default: c("taxonomic", "range").

fun_methods

Character vector of methods to use for regional functional rarity. Default: c("min_distance", "mean_distance").

abundances

Logical vector indicating whether to include abundance in local phylogenetic rarity calculations. Default: c(TRUE, FALSE).

threshold_sets

List of named numeric vectors defining rarity thresholds for each combination. Must be the same length as direction_sets.

direction_sets

List of named character vectors ("high"/"low") defining threshold directions for each combination. Must be the same length as threshold_sets.

species_col

Name of the species identifier column in data frames. Default: "species".

use_internal_phylo

Logical, whether to use an internal seed plant phylogeny. Default: TRUE.

internal_phylo_name

Name of the internal seed plant phylogeny to use if applicable. Default: "ALLMB". Options: "ALLMB", "ALLOTB", "GBMB", "GBOTB".

k_means

Logical, whether to apply k-means clustering. Default: FALSE.

additional_dimensions

Optional list of additional custom rarity axes to include in the analysis.

model

Optional specific restriction to pass through the pipeline. Default: NULL.

phylo

An optional phylogenetic tree of class phylo. If provided and use_internal_phylo is FALSE, this tree will be used for phylogenetic rarity calculations.

verbose

Logical, whether to print progress messages. Default: TRUE.

Value

A list with elements:

  • results: List of data frames with rarity categorizations for restrictions per method combo.

  • threshold_sets: Data frame summarizing threshold sets used.

  • direction_sets: Data frame summarizing direction sets used.

  • param_grid: Data frame with the full parameter grid combinations.