mp_cal_upset | R Documentation |
Calculating the samples or groups for each OTU, the result can be visualized by 'ggupset'
mp_cal_upset(
.data,
.group,
.abundance = NULL,
action = "add",
force = FALSE,
...
)
## S4 method for signature 'MPSE'
mp_cal_upset(
.data,
.group,
.abundance = NULL,
action = "add",
force = FALSE,
...
)
## S4 method for signature 'tbl_mpse'
mp_cal_upset(
.data,
.group,
.abundance = NULL,
action = "add",
force = FALSE,
...
)
## S4 method for signature 'grouped_df_mpse'
mp_cal_upset(
.data,
.group,
.abundance = NULL,
action = "add",
force = FALSE,
...
)
.data |
MPSE or tbl_mpse object |
.group |
the name of group to be calculated. if it is no provided, the sample will be used. |
.abundance |
the name of otu abundance to be calculated. if it is null, the rarefied abundance will be used. |
action |
character, "add" joins the new information to the tibble of tbl_mpse or rowData of MPSE. "only" and "get" return a non-redundant tibble with the just new information. which is a treedata object. |
force |
logical whether calculate the relative abundance forcibly when the abundance is not be rarefied, default is FALSE. |
... |
additional parameters. |
update object or tibble according the 'action'
Shuangbin Xu
[mp_plot_upset()]
data(mouse.time.mpse)
mpse <- mouse.time.mpse %>%
mp_rrarefy() %>%
mp_cal_upset(.abundance=RareAbundance, .group=time, action="add")
mpse
library(ggplot2)
library(ggupset)
p <- mpse %>% mp_plot_upset(.group=time, .upset=ggupsetOftime)
p
# or set action="only"
## Not run:
tbl <- mouse.time.mpse %>%
mp_rrarefy() %>%
mp_cal_upset(.abundance=RareAbundance, .group=time, action="only")
tbl
p2 <- tbl %>%
ggplot(aes(x=ggupsetOftime)) +
geom_bar() +
ggupset::scale_x_upset() +
ggupset::theme_combmatrix(combmatrix.label.extra_spacing=30)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.