ggbetween_pq {MiscMetabar}R Documentation

Box/Violin plots for between-subjects comparisons of Hill Number

Description

[Experimental]

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

Usage

ggbetween_pq(physeq, fact, one_plot = FALSE, rarefy_by_sample = FALSE, ...)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

fact

(required): The variable to test. Must be present in the sam_data slot of the physeq object.

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 phyloseq::rarefy_even_depth() function

...

Other arguments passed on to ggstatsplot::ggbetweenstats() function.

Details

This function is mainly a wrapper of the work of others. Please make a reference to ggstatsplot::ggbetweenstats() if you use this function.

Value

Either an unique ggplot2 object (if one_plot is TRUE) or a list of 3 ggplot2 plot:

Author(s)

Adrien Taudière

Examples


if (requireNamespace("ggstatsplot")) {
  p <- ggbetween_pq(data_fungi, fact = "Time", p.adjust.method = "BH")
  p[[1]]
  ggbetween_pq(data_fungi, fact = "Height", one_plot = TRUE)
  ggbetween_pq(data_fungi, fact = "Height", one_plot = TRUE, rarefy_by_sample = TRUE)
}


[Package MiscMetabar version 0.9.1 Index]