spp_strategy: Classify species ecological strategies

View source: R/spp_strategy.R

spp_strategyR Documentation

Classify species ecological strategies

Description

This function analyses the outputs of spp_trend() to classify species into distinct spatial or thermal response categories based on the direction and statistical significance of their species-specific trends relative to the overall trend. The function incorporates hemisphere-specific logic to correctly interpret poleward shifts in latitude and can also be applied to classify elevational trends.

Usage

spp_strategy(spp_trend_result, sig_level = 0.05, responses = responses)

Arguments

spp_trend_result

A data frame containing trend indicators per species, typically generated by the spp_trend function. It should include columns such as:

  • species: Name of the analyzed species.

  • responses: Name of the analyzed variable.

  • trend: Estimated slope of the linear model.

  • t: t-statistic for the species-specific trend.

  • pvalue: Statistical significance of the species-specific trend.

  • dif_t: t-statistic of the interaction term, indicating the magnitude of the difference between the species trend and the Overall Trend (OT).

  • dif_pvalue: p-values of the interaction term. A low value indicates a significant deviation from the general trend.

  • n: Total number of occurrence records (sample size) for the specific species.

  • hemisphere: Geographical subset (North, South, or Global) used to ensure latitudinal symmetry in the analysis.

sig_level

The numeric significance level to use for classifying trends as significant. Defaults to 0.05. See Bonferroni correction 0.05/length(species).

responses

A ⁠character vector⁠ of response variable names to analyze (c("lat", "lon", "tme", "ele")). The function will create classification columns for responses present in this vector and in the responses column of spp_trend_result.

Details

This function takes the trend analysis results from spp_trend and classifies each species' response based on the significance of its trend and how it differs from the general trend. Applied Bonferroni correction to avoid false positives (Type I errors) due to multiple comparisons when analyzing many species. The classification identifying three possible spatial responses and three thermal responses:

  • Spatial Responses:

    • Spatial Adaptation (SA): A significant positive temporal trend in the spatial position of species occurrences. In the context of climate change, this pattern is commonly associated with a poleward shift, corresponding to a northward displacement (towards higher latitude values) in the Northern Hemisphere and southward displacement (towards lower latitude values) in the Southern Hemisphere, as species expand into newly suitable areas.

    • Spatial Discordance (SD): A significant negative temporal trend in the spatial position of species occurrences. In the context of climate change, this pattern is often associated with an equatorward shift and may arise when other ecological and anthropogenic factors influence species distributions independently of, or in opposition to, climate-driven range shifts.

    • Spatial Conformity (SC): A spatial response pattern in which the species-specific temporal trend does not differ significantly from the overall trend. Species showing spatial conformance share the same bias structure as the complete dataset, preventing the inference of a distinct, species-specific response to climate change at the scale of analysis.

  • Thermal Responses:

    • Thermal Tolerance (TT): A thermal response pattern characterised by a significant positive temporal trend in the temperature conditions under which species are observed, relative to the overall trend. This pattern suggest an increased likelihood of occurrence under warmer conditions and an apparent capacity to tolerate rising temperatures through physiological, behavioural, and evolutionary mechanisms.

    • Thermal Adjustment (TA): A thermal response characterised by a significant negative temporal trend in the temperature conditions associated with species occurrences, relative to the overall trend. This indicates and increasing association with cooler temperature conditions over time, potentially reflecting microevolutionary change or phenotypic adjustment.

    • Thermal Conformity (TC): A thermal response pattern in which species-specific temperature trends do not differ significantly from the overall trend. Species showing thermal conformance share the same background thermal signal as the complete dataset, preventing the formulation of specific hypotheses regarding climate-driven thermal responses.

Note: The interpretation of longitude trends assumes that if transformation was applied in spp_trend, it used the Antimeridian as 0.

Value

A ⁠data frame⁠ summarizing the ecological strategy of each species for each analyzed response variable. The table includes:

  • Species name

  • Hemisphere

  • Sample size

  • Classification columns for:

    • Spatial (latitude, longitude and elevation if present) responses. Spatial Adaptation SA, Spatial Discordance SD, Spatial Conformity SC

    • Thermal (temperature if present) responses. Thermal Tolerance TT, Thermal Adjustment TA, Thermal Conformity TC

Classification for spatial responses (lat, lon, ele) are classified as Spatial_lat, Spatial_lon and Spatial_ele. Thermal responses (tme) are classified as Thermal_tme.

Examples


# Assuming spp_trends_results is a data frame generated by spp_trend()

spp_trends_results <- data.frame(
  species = paste0("spp_", 1:10),
  responses = rep(c("lat", "lon", "tme"), length.out = 30),
  trend = runif(30, -0.5, 0.5),
  t = runif(30, -2, 2),
  pvalue = runif(30, 0, 1),
  dif_t = runif(30, -1, 1.5),
  dif_pvalue = runif(30, 0.001, 0.9),
  n = round(runif(30, 40, 60)),
  hemisphere = sample(c("North", "South", "Global"), 30, replace = TRUE)
)

spp <- unique(spp_trends_results$species)
sig_level <- 0.05 / length(spp) # Bonferroni correction
responses_to_analyze <- c("lat", "lon", "tme")

spp_strategy_results <- spp_strategy(spp_trends_results,
                                     sig_level = sig_level,
                                     responses = responses_to_analyze)

print(spp_strategy_results)


SppTrend documentation built on Feb. 7, 2026, 5:07 p.m.