plot_rarefaction | R Documentation |
Plot rarefaction curves for each treatment group
plot_rarefaction(
mob_in,
group_var,
ref_level = NULL,
method,
spat_algo = NULL,
dens_ratio = 1,
scales = c("alpha", "gamma", "study"),
raw = TRUE,
smooth = FALSE,
avg = FALSE,
col = NULL,
lwd = 3,
log = "",
leg_loc = "topleft",
one_panel = FALSE,
...
)
mob_in |
a 'mob_in' class object produced by 'make_mob_in' |
group_var |
String that specifies which field in |
ref_level |
String that defines the reference level of |
method |
a character string that specifies the method of rarefaction curve construction it can be one of the following:
|
spat_algo |
character string that can be either: |
dens_ratio |
the ratio of individual density between a reference group and the community data (i.e., x) under consideration. This argument is used to rescale the rarefaction curve when estimating the effect of individual density on group differences in richness. |
scales |
character string which defaults to c('alpha', 'gamma', 'study') indicating that rarefaction curves at the alpha (i.e., single plot), gamma (i.e., group of plots), and study (i.e., all plots) scales should be computed and plotted. |
raw |
boolean. Defaults to TRUE so that raw rarefaction curves without averaging or smoothing are plotted |
smooth |
boolean. Defaults to FALSE. If set to TRUE a lowess smoother is used on the 'alpha' scale curves. Has no effect at gamma or study scales |
avg |
boolean. Defaults to FALSE. If set to TRUE then the average richness across the groups is computed and plotted. |
col |
optional vector of colors. |
lwd |
a number which specifies the width of the lines |
log |
a string that specifies if any axes are to be log transformed, options include 'x', 'y' or 'xy' in which either the x-axis, y-axis, or both axes are log transformed respectively |
leg_loc |
a string that specifies the location of the legend, options include: 'lowerleft', 'topleft', 'loweright','topright' |
one_panel |
boolean. Defaults to FALSE. If set to TRUE then the alpha scale and gamma scale curves are put on the same graph. |
... |
other arguments to provide to |
data(inv_comm)
data(inv_plot_attr)
inv_mob_in = make_mob_in(inv_comm, inv_plot_attr, coord_names = c('x', 'y'))
# random individual based rarefaction curves
par(mfrow=c(1,2))
plot_rarefaction(inv_mob_in, 'group', 'uninvaded', 'IBR',
leg_loc='bottomright')
plot_rarefaction(inv_mob_in, 'group', 'uninvaded', 'IBR',
log='xy')
# random sample based rarefaction curves
plot_rarefaction(inv_mob_in, 'group', 'uninvaded', 'SBR', log='xy',
leg_loc='bottomright')
# spatial sample based rarefaction curves
plot_rarefaction(inv_mob_in, 'group', 'uninvaded', 'sSBR', log='xy',
leg_loc='bottomright', avg = TRUE, smooth = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.