LHS_plot: Generate a 3D scatterplot of plant traits

View source: R/LHS.R

LHS_plotR Documentation

Generate a 3D scatterplot of plant traits

Description

This function creates a three-dimensional scatterplot of plant traits (Specific Leaf Area, Height, and Seed Mass) based on the Leaf-Height-Seed (LHS) plant ecology strategy scheme.

Usage

LHS_plot(
  data,
  colors = c("#30123BFF", "#4777EFFF", "#1BD0D5FF", "#62FC6BFF", "#D2E935FF",
    "#FE9B2DFF", "#DB3A07FF", "#7A0403FF"),
  log_transform = TRUE
)

Arguments

data

A data frame containing columns: SLA, Height, SeedMass, and LHS_strategy.

colors

A vector of colors for different LHS strategies. Default is a predefined color palette.

log_transform

Logical, indicating whether to log-transform the data. Default is TRUE.

Details

The function performs the following steps: Checks if the input data contains the required columns. Converts LHS_strategy to a factor. Optionally log-transforms the data based on the log_transform parameter. Creates a 3D scatterplot using (potentially log-transformed) values of SLA, Height, and Seed Mass. Colors points based on LHS strategy. Adds a legend to identify different LHS strategies.

Value

A 3D scatterplot of SLA, Height, and Seed Mass (optionally log-transformed), with points colored by LHS strategy.

References

  1. Westoby, M. (1998). A leaf-height-seed (LHS) plant ecology strategy scheme. Plant and Soil, 199, 213–227. https://doi.org/10.1023/A:1004327224729

  2. Yang, J., Wang, Z., Zheng, Y., & Pan, Y. (2022). Shifts in plant ecological strategies in remnant forest patches along urbanization gradients. Forest Ecology and Management, 524, 120540. https://doi.org/10.1016/j.foreco.2022.120540

Examples

data(PFF)
pff <- PFF[, c("SLA", "Height", "SeedMass")]
result <- LHS(pff)
LHS_plot(result)
LHS_plot(result, log_transform = FALSE)


MultiTraits documentation built on April 16, 2025, 9:07 a.m.