
Last chance! 50% off unlimited learning
Sale ends in
plotDiversityTest
plots summary data for a DiversityCurve
object
with mean and a line range indicating plus/minus one standard deviation.
plotDiversityTest(
data,
q,
colors = NULL,
main_title = "Diversity",
legend_title = "Group",
log_d = FALSE,
annotate = c("none", "depth"),
silent = FALSE,
...
)
A ggplot
object defining the plot.
DiversityCurve object returned by alphaDiversity.
diversity order to plot the test for.
named character vector whose names are values in the
group
column of the data
slot of data
,
and whose values are colors to assign to those group names.
string specifying the plot title.
string specifying the legend title.
if TRUE
then plot the diversity scores FALSE
plot on a linear scale.
string defining whether to added values to the group labels
of the legend. When "none"
(default) is specified no
annotations are added. Specifying ("depth"
) adds
sequence counts to the labels.
if TRUE
do not draw the plot and just return the ggplot2
object; if FALSE
draw the plot.
additional arguments to pass to ggplot2::theme.
See alphaDiversity for generating input. Plotting is performed with ggplot.
# Calculate diversity
div <- alphaDiversity(ExampleDb, group="sample_id", min_q=0, max_q=2, step_q=1, nboot=100)
# Plot results at q=0 (equivalent to species richness)
plotDiversityTest(div, 0, legend_title="Sample")
# Plot results at q=2 (equivalent to Simpson's index)
plotDiversityTest(div, q=2, legend_title="Sample")
Run the code above in your browser using DataLab