Learn R Programming

easynem (version 1.0.3)

trans_combine: Merge multiple columns of easynem's meta

Description

The trans_combine() is used for the special case of merging columns in easynem's meta. For example, Cp35% (the sum of percentages from Cp3 to Cp5) is often used in nematode community analysis. This function can quickly merge Cp3 to Cp5.

Usage

trans_combine(data, col)

Value

An easynem-class data.

Arguments

data

An easynem-class data.

col

The name of the column to be summed.

Details

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

nem_trans <- nem |> trans_combine(c("3", "4", "5"))

See Also

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

Examples

Run this code
nem <- read_nem2(tab = nemtab, tax = nemtax, meta = nemmeta)
nem_trans <- nem |>
             trans_name(cp_value) |>
             trans_norm(method = percent) |>
             trans_combine(c("3", "4", "5"))
show(nem_trans)
nem_trans@meta$`3_4_5`

Run the code above in your browser using DataLab