mp_dmn-methods: Fit Dirichlet-Multinomial models to MPSE or tbl_mpse

mp_dmnR Documentation

Fit Dirichlet-Multinomial models to MPSE or tbl_mpse

Description

Fit Dirichlet-Multinomial models to MPSE or tbl_mpse

Usage

mp_dmn(.data, .abundance, k = 1, seed = 123, mc.cores = 2, action = "get", ...)

## S4 method for signature 'MPSE'
mp_dmn(.data, .abundance, k = 1, seed = 123, mc.cores = 2, action = "get", ...)

## S4 method for signature 'tbl_mpse'
mp_dmn(.data, .abundance, k = 1, seed = 123, mc.cores = 2, action = "get", ...)

## S4 method for signature 'grouped_df_mpse'
mp_dmn(.data, .abundance, k = 1, seed = 123, mc.cores = 2, action = "get", ...)

Arguments

.data

MPSE or tbl_mpse object

.abundance

The column name of OTU abundance column to be calculate.

k

the number of Dirichlet components to fit, default is 1.

seed

random number seed to be reproducible, default is 123.

mc.cores

The number of cores to use, default is 2.

action

character it has three options, 'get' return a 'list' contained DMN (default), "add" joins the new information to the input (can be extracted with mp_extract_internal_attr(name='DMN')), "only" return a non-redundant tibble with the just new information a column contained 'DMN'.

...

additional parameters, see also the mclapply and dmn.

Value

update object or other (refer to action)

Examples

## Not run: 
data(mouse.time.mpse)
res <- mouse.time.mpse %>% 
       mp_dmn(.abundance = Abundance, 
              k = seq_len(2), 
              mc.cores = 4, 
              action = 'get')
res

## End(Not run)

xiangpin/MicrobiotaProcess documentation built on Nov. 12, 2024, 2:05 p.m.