View source: R/plot_functions.R
| ggbetween_pq | R Documentation |
Note that contrary to hill_pq(), this function does not take into
account for difference in the number of sequences per samples/modalities.
You may use rarefy_by_sample = TRUE if the mean number of sequences per
samples differs among modalities.
Basically a wrapper of function ggstatsplot::ggbetweenstats() for
object of class phyloseq
ggbetween_pq(
physeq,
fact,
one_plot = FALSE,
rarefy_by_sample = FALSE,
rngseed = FALSE,
verbose = TRUE,
q = c(0, 1, 2),
...
)
physeq |
(required) a |
fact |
(required) The variable to test. Must be present in
the |
one_plot |
(logical, default FALSE) If TRUE, return a unique plot with the three plot inside using the patchwork package. |
rarefy_by_sample |
(logical, default FALSE) If TRUE, rarefy
samples using |
rngseed |
(Optional). A single integer value passed to
|
verbose |
(logical). If TRUE, print additional information. |
q |
(numeric vector, default |
... |
Additional arguments passed on to |
This function is mainly a wrapper of the work of others.
Please make a reference to ggstatsplot::ggbetweenstats() if you
use this function.
Either an unique ggplot2 object (if one_plot is TRUE) or
a list of ggplot2 plots, one per Hill order in q. With default q:
plot_Hill_0 : the ggbetweenstats of Hill number 0 (= species richness) against the variable fact
plot_Hill_1 : the ggbetweenstats of Hill number 1 (= Shannon index) against the variable fact
plot_Hill_2 : the ggbetweenstats of Hill number 2 (= Simpson index) against the variable fact
Adrien Taudière
Alberdi, A., & Gilbert, M. T. P. (2019). A guide to the application of Hill numbers to DNA-based diversity analyses. Molecular Ecology Resources. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/1755-0998.13014")}
Calderón-Sanou, I., Münkemüller, T., Boyer, F., Zinger, L., & Thuiller, W. (2019). From environmental DNA sequences to ecological conclusions: How strong is the influence of methodological choices? Journal of Biogeography, 47. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/jbi.13681")}
library("divent")
if (requireNamespace("ggstatsplot")) {
data_f <- clean_pq(prune_samples(
sample_names(data_fungi_sp_known)[1:10],
data_fungi_sp_known
))
p <- ggbetween_pq(data_f, fact = "Time", p.adjust.method = "BH")
p[[1]]
}
## Not run:
if (requireNamespace("ggstatsplot")) {
ggbetween_pq(data_fungi, fact = "Height", one_plot = TRUE)
ggbetween_pq(data_fungi, fact = "Height", one_plot = TRUE, rarefy_by_sample = TRUE)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.