Learn R Programming

MultiTraits (version 0.5.0)

CSR_plot: Create a ternary plot of CSR strategies

Description

This function creates a ternary plot of Competition-Stress-Ruderal (CSR) strategies using the ggtern package.

Usage

CSR_plot(
  data,
  point_size = 3,
  point_shape = 21,
  expand_margin = 1,
  custom_colors = c("#57C4AD", "#E6E1BC", "#EDA348", "#006165", "#F8E3EF", "#FFFF99",
    "#376CB1", "#B2589B", "#DC4325", "#F16C4E", "#85B97B", "#FCEB2D", "#04A89E",
    "#F49320", "#8F88C1", "#33B5D9", "#440153", "#B29BBD", "#28C865")
)

Value

A ggplot object representing the ternary plot of CSR strategies.

Arguments

data

A dataframe containing required columns: C, S, R (numeric values between 0-1) and type (categorical classification)

point_size

Numeric, diameter of plot points (default = 3)

point_shape

Numeric, symbol code for data points (default = 21, circle with border)

expand_margin

Numeric, coefficient for plot margin expansion (default = 1)

custom_colors

Character vector specifying hex color codes for categorical types

Details

This function implements:

  • Configurable point attributes (size, shape)

  • Adjustable plot boundaries

  • User-defined color schemes for categories

  • Automated legend column optimization

  • Standardized legend positioning

  • Reference grid and directional indicators

References

  1. Grime, J.P. (1974). Vegetation classification by reference to strategies. Nature, 250, 26–31.

  2. Pierce, S., Negreiros, D., Cerabolini, B.E.L., Kattge, J., Díaz, S., et al. (2017). A global method for calculating plant CSR ecological strategies applied across biomes world-wide. Funct Ecol, 31: 444-457.

Examples

Run this code
data(PFF)
head(PFF)
traits <- data.frame(LA=PFF$Leaf_area, LDMC=PFF$LDMC, SLA=PFF$SLA)
head(traits)
result <- CSR(data = traits)
head(result)
CSR_plot(data=result)

Run the code above in your browser using DataLab