Skip to contents

Plots the values of one trait, choosing the plot from the trait's type: plot_trait_distribution_jitter() by family for a numeric trait, plot_categorical_trait_distribution() for a categorical one.

Usage

plot_trait_distribution(database, trait_name, ...)

Arguments

database

traits.build database (list object), or its traits table (which must then have a family column, e.g. from join_taxa())

trait_name

Name of the trait to plot (matched exactly)

...

Further named arguments: y_axis_category (default "family"), highlight and hide_ids for a numeric trait, passed to plot_trait_distribution_jitter(); family_count for a categorical trait, passed to plot_categorical_trait_distribution(). Arguments the chosen plot does not take are ignored, so one set of arguments can be used for traits of both types.

Value

A ggplot object. With no values to plot (an empty or NULL input, or a trait not in it), a blank plot saying so.

Examples

austraits_lite %>% plot_trait_distribution("wood_density")

austraits_lite %>% plot_trait_distribution("leaf_compoundness")