mp_cal_divergence | R Documentation |
calculate the divergence with MPSE or tbl_mpse
mp_cal_divergence(
.data,
.abundance,
.name = "divergence",
reference = "mean",
distFUN = vegan::vegdist,
method = "bray",
action = "add",
...
)
## S4 method for signature 'MPSE'
mp_cal_divergence(
.data,
.abundance,
.name = "divergence",
reference = "mean",
distFUN = vegan::vegdist,
method = "bray",
action = "add",
...
)
## S4 method for signature 'tbl_mpse'
mp_cal_divergence(
.data,
.abundance,
.name = "divergence",
reference = "mean",
distFUN = vegan::vegdist,
method = "bray",
action = "add",
...
)
## S4 method for signature 'grouped_df_mpse'
mp_cal_divergence(
.data,
.abundance,
.name = "divergence",
reference = "mean",
distFUN = vegan::vegdist,
method = "bray",
action = "add",
...
)
.data |
MPSE or tbl_mpse object |
.abundance |
The column name of OTU abundance column to be calculate. |
.name |
the colname name of the divergence results, default is 'divergence'. |
reference |
a no-empty character, either 'median' or 'mean' or the sample name, or a numeric vector which has length equal to the number of features, default is 'mean'. |
distFUN |
the function to calculate the distance between the reference and samples, default is 'vegan::vegdist'. |
method |
the method to calculate the distance, which will pass to the function that is specified in 'distFUN', default is 'bray'. |
action |
character it has three options, "add" joins the new information to the input tbl (default), "only" return a non-redundant tibble with the just new information, ang 'get' return a 'alphasample' object. |
... |
additional arguments, see also the arguments of 'distFUN' function. |
update object or other (refer to action)
Shuangbin Xu
[mp_plot_alpha()]
## Not run:
# example(mp_cal_divergence, run.dontrun = TRUE) to run the example.
data(mouse.time.mpse)
mouse.time.mpse %>%
mp_cal_divergence(
.abundance = Abundance,
.name = 'divergence.mean',
distFUN = vegan::vegdist,
method = 'bray'
) %>%
mp_plot_alpha(
.alpha = divergence.mean,
.group = time,
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.