plot_rarefaction {mobr} | R Documentation |
Plot rarefaction curves for each treatment group
Description
Plot rarefaction curves for each treatment group
Usage
plot_rarefaction(
mob_in,
group_var,
ref_level = NULL,
method,
dens_ratio = 1,
pooled = TRUE,
spat_algo = NULL,
col = NULL,
lwd = 3,
log = "",
leg_loc = "topleft",
...
)
Arguments
mob_in |
an object of class mob_in created 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:
|
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. |
pooled |
Boolean specifying if samples should be pooled at the group
level or not. Defaults to TRUE. This argument only applies when
the individual based rarefaction is used (i.e., |
spat_algo |
character string that can be either: |
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' |
... |
other arguments to provide to |
Examples
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
plot_rarefaction(inv_mob_in, 'group', 'uninvaded', 'IBR',
pooled=TRUE, leg_loc='bottomright')
plot_rarefaction(inv_mob_in, 'group', 'uninvaded', 'IBR',
pooled=FALSE, log='x')
# random sample based rarefaction curves
plot_rarefaction(inv_mob_in, 'group', 'uninvaded', 'SBR', log='xy')
# spatial sample based rarefaction curves
plot_rarefaction(inv_mob_in, 'group', 'uninvaded', 'sSBR', log='xy')