plot_comm_trait_evolution: Plot the evolution of trait values in the community over...

View source: R/plot_comm_trait_evolution.R

plot_comm_trait_evolutionR Documentation

Plot the evolution of trait values in the community over generations

Description

Produces a hex-density plot of all trait values in the community over generations.

Usage

plot_comm_trait_evolution(
  comrad_tbl,
  generation_range = c(0, Inf),
  xgrain = 200,
  ygrain = 0.01,
  xlim = NULL,
  ylim = NULL,
  alpha = 0.95,
  hex_fill = "species"
)

Arguments

comrad_tbl

a tibble containing the output of a comrad simulation, as produced by run_simulation().

generation_range

numeric vector with length 2, supplying the first and last generation to plot from the dataset. Defaults to every generation in the table

xgrain

numeric, the width of hexes on the x-axis (generations)

ygrain

numeric, the width of hexes on the y-axis (trait)

xlim

numeric vector, the range of x-values, passed to ggplot::coord_cartesian() if not NULL.

ylim

numeric vector, the range of y-values, passed to ggplot::coord_cartesian() if not NULL.

alpha

numeric, the transparency of the hexes

hex_fill

character with two options, "counts" and "species". "counts" colours hexes by the count of individuals, and "species" by species identity.

Author(s)

Théo Pannetier


TheoPannetier/comrad documentation built on April 8, 2023, 8:06 a.m.