trans_formula_v: Formula conversion for easynem's meta (Vectorization)

View source: R/trans_formula_v.R

trans_formula_vR Documentation

Formula conversion for easynem's meta (Vectorization)

Description

The trans_formula_v() is used to convert the formula of easynem meta. Formula transformation is sometimes necessary in nematode community analysis. For example, to ensure that the data is normally distributed, it is often necessary to perform ln(x+1) transformation or other forms of formula transformation on nematode abundance. This function can transfer vectors to achieve multi-variable formula conversion. For a univariate simplified version of this function, see trans_formula.

Usage

trans_formula_v(data, var, formu)

Arguments

data

An easynem-class data.

var

Vectorized variable names for formula conversion.

formu

Formula parameters for data conversion. Such as ~log(x+1).

Details

To facilitate code interpretation, it is recommended to use the pipe symbol |> to connect functions:

nem_trans <- nem |> trans_formula_v(colnames(resultmeta)[5:10], ~log(x+1))

Value

An easynem-class data that stores the result of formula conversion.

See Also

Other functions in this package for filtering and transforming data sets: filter_name, filter_num, trans_formula, trans_name, trans_norm, trans_rare, trans_combine

Examples

nem <- read_nem2(tab = nemtab, tax = nemtax, meta = nemmeta)
nem_trans <- nem |> trans_formula_v(nem@tab$OTUID, ~log(x+1))
show(nem_trans)

easynem documentation built on Nov. 5, 2025, 7:39 p.m.