Learn R Programming

glossa (version 1.2.1)

glossa_analysis: Main Analysis Function for GLOSSA Package

Description

This function wraps all the analysis that the GLOSSA package performs. It processes presence-absence data, environmental covariates, and performs species distribution modeling and projections under past and future scenarios.

Usage

glossa_analysis(
  pa_data = NULL,
  fit_layers = NULL,
  proj_files = NULL,
  study_area_poly = NULL,
  predictor_variables = NULL,
  thinning_method = NULL,
  thinning_value = NULL,
  scale_layers = FALSE,
  buffer = NULL,
  native_range = NULL,
  suitable_habitat = NULL,
  other_analysis = NULL,
  model_args = list(),
  cv_methods = NULL,
  cv_folds = 5,
  cv_block_source = "residuals_autocorrelation",
  cv_block_size = NULL,
  pseudoabsence_method = "random",
  pa_ratio = 1,
  target_group_points = NULL,
  pa_buffer_distance = NULL,
  seed = NA,
  waiter = NULL
)

Value

A list containing structured outputs from each major section of the analysis, including model data, projections, variable importance scores, and habitat suitability assessments.

Arguments

pa_data

A list of data frames containing presence-absence data including `decimalLongitude`, `decimalLatitude`, `timestamp`, and `pa` columns.

fit_layers

A ZIP file with the raster files containing model fitting environmental layers formatted as explained in the website documentation.

proj_files

A list of ZIP file paths containing environmental layers for projection scenarios.

study_area_poly

A spatial polygon defining the study area.

predictor_variables

A list of the predictor variables to be used in the analysis for each occurrence dataset.

thinning_method

A character specifying the spatial thinning method to apply to occurrence data. Options are `c("none", "distance", "grid", "precision")`. See `GeoThinneR` package for details.

thinning_value

A numeric value used for thinning depending on the selected method: distance in meters (`distance`), grid resolution in degrees (`grid`), or decimal precision (`precision`).

scale_layers

Logical; if `TRUE`, covariate layers will be standardize (z-score) based on fit layers.

buffer

Buffer value or distance in decimal degrees (arc_degrees) for buffering the study area polygon.

native_range

A vector of scenarios `c('fit_layers', 'projections')` where native range modeling should be performed.

suitable_habitat

A vector of scenarios `c('fit_layers', 'projections')` where habitat suitability modeling should be performed.

other_analysis

A vector of additional analyses to perform (e.g., `'variable_importance', 'functional_responses', 'cross_validation'`).

model_args

A named list of additional arguments passed to the modeling function (e.g., `dbarts::bart`). This allows users to fine-tune model parameters such as `ntree` or `k`. These are passed internally via `...` and must match the arguments of the selected model function.

cv_methods

A vector of the cross-validation strategies to perform. One or multiple of `"k-fold"`, `"spatial_blocks"`, `"temporal_blocks"`.

cv_folds

Integer indicating the number of folds to generate.

cv_block_source

For spatial blocks, how to determine block size. One of: `"residuals_autocorrelation"`, `"predictors_autocorrelation"`, `"manual"`.

cv_block_size

Numeric block size in meters (used if `cv_block_source = "manual"`).

pseudoabsence_method

Method for generating pseudo-absences. One of "random", "target_group", or "buffer_out".

pa_ratio

Ratio of pseudo-absences to presences (pseudo-absence:presences).

target_group_points

Optional data frame for sampling points for target-group method.

pa_buffer_distance

Numeric buffer radius in degrees around each presence. Default is NULL.

seed

Optional; an integer seed for reproducibility of results.

waiter

Optional; a waiter instance to update progress in a Shiny application.