plot.mob_stats: Plot alpha- and gamma-scale biodiversity statistics for a MoB...

View source: R/mobr_boxplots.R

plot.mob_statsR Documentation

Plot alpha- and gamma-scale biodiversity statistics for a MoB analysis

Description

Plots a mob_stats object which is produced by the function get_mob_stats. The p-value for each statistic is displayed in the plot title if applicable.

Usage

## S3 method for class 'mob_stats'
plot(
  x,
  index = NULL,
  multi_panel = FALSE,
  col = c("#FFB3B5", "#78D3EC", "#6BDABD", "#C5C0FE", "#E2C288", "#F7B0E6", "#AAD28C"),
  cex.axis = 1.2,
  ...
)

Arguments

x

a mob_stats object that has the samples and treatment level statistics

index

The biodiversity statistics that should be plotted. See get_mob_stats for information on the indices. By default there is one figure for each index, with panels for alpha- and gamma-scale results as well as for beta-diversity when applicable.

multi_panel

A logical variable. If multi_panel = TRUE then a multipanel plot is produced, which shows observed, rarefied, and asymptotic species richness and S_PIE at the alpha- and gamma-scale. This set of variables conveys a comprehensive picture of the underlying biodiversity changes.

col

a vector of colors for the groups, set to NA if no color is preferred

cex.axis

The magnification to be used for axis annotation relative to the current setting of cex. Defaults to 1.2.

...

additional arguments to provide to boxplot, points, and confidence interval functions

Details

The user may specify which results to plot or simply to plot all the results.

Author(s)

Felix May, Xiao Xiao, and Dan McGlinn

Examples

data(inv_comm)
data(inv_plot_attr)
inv_mob_in = make_mob_in(inv_comm, inv_plot_attr)
# without bootstrap CI for gamma-scale
inv_stats = get_mob_stats(inv_mob_in, group_var = "group", n_perm = 20)
plot(inv_stats) 
# with bootstrap CI for gamma-scale
inv_stats_boot = get_mob_stats(inv_mob_in, group_var = "group", n_perm = 20,
                               boot_groups=TRUE)
plot(inv_stats_boot)

MoBiodiv/mobr documentation built on Jan. 31, 2024, 6:15 p.m.