mp_cal_cca {MicrobiotaProcess} | R Documentation

## [Partial] [Constrained] Correspondence Analysis with MPSE or tbl_mpse object

### Description

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

### Usage

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

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

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

    ## S4 method for signature 'grouped_df_mpse'
    mp_cal_cca(.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 cca result to the object, "only" return a non-redundant tibble with the cca result. "get" return 'cca' object can be analyzed using the related vegan funtion.
`...` | additional parameters see also 'cca' 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_cca(.abundance=Abundance,
                   .formula=~Al + P*(K + Baresoil),
                   action="add")
    mpse
    mpse %>% mp_plot_ord(.ord=CCA, .group=Al, .size=K, show.sample=FALSE, bg.colour="black", colour="white")

[Package MicrobiotaProcess version 1.4.4 Index]