mp_cal_rda-methods: [Partial] [Constrained] Redundancy Analysis with MPSE or...

mp_cal_rdaR Documentation

[Partial] [Constrained] Redundancy Analysis with MPSE or tbl_mpse object

Description

[Partial] [Constrained] Redundancy Analysis with MPSE or tbl_mpse object

Usage

mp_cal_rda(.data, .abundance, .formula = NULL, .dim = 3, action = "add", ...)

## S4 method for signature 'MPSE'
mp_cal_rda(.data, .abundance, .formula = NULL, .dim = 3, action = "add", ...)

## S4 method for signature 'tbl_mpse'
mp_cal_rda(.data, .abundance, .formula = NULL, .dim = 3, action = "add", ...)

## S4 method for signature 'grouped_df_mpse'
mp_cal_rda(.data, .abundance, .formula = NULL, .dim = 3, action = "add", ...)

Arguments

.data

MPSE or tbl_mpse object

.abundance

the name of abundance to be calculated.

.formula

Model formula right hand side gives the constraining variables, and conditioning variables can be given within a special function 'Condition' and keep left empty, such as ~ A + B or ~ A + Condition(B), default is NULL.

.dim

integer The number of dimensions to be returned, default is 3.

action

character "add" joins the rda result to the object, "only" return a non-redundant tibble with the rda result. "get" return 'rda' object can be analyzed using the related vegan funtion.

...

additional parameters see also 'rda' of vegan.

Value

update object according action argument

Author(s)

Shuangbin Xu

Examples

library(vegan)
data(varespec, varechem)
mpse <- MPSE(assays=list(Abundance=t(varespec)), colData=varechem)
mpse
mpse %>% 
  mp_cal_rda(.abundance=Abundance, 
             .formula=~Al + P*(K + Baresoil),
             .dim = 3,
             action="add") %>%
  mp_plot_ord(show.sample=TRUE)

YuLab-SMU/MicrobiotaProcess documentation built on July 26, 2024, 4:21 a.m.