wideTab.to.hierarchicalTab: convert a wide table to hierarchical table

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/DataFormat_Utils.R

Description

turns a regular wide table into a hierarchical recursive table.

Usage

1
wideTab.to.hierarchicalTab(dataset, col_hierarchy)

Arguments

dataset

a data.frame. The wide table to be transformed, with columns as hierarchical variables. T

col_hierarchy

a data.frame with two columns named "child" and "parent". The hierarchical relations between the columns formatted in a child-parent table listing the column names. Use "root" or NA for columns with no parent.

Details

Columns in the input data with different levels of a hierarchy are poolled into one column with values and a second column indicating the parent of the value.

Value

a data.frame with three columns: one for the value (cell content in the origical data.frame), it's rank (the original column name), and parent (cell content of the column that is one up in the hierarchy)

Author(s)

Maxime Sweetlove

See Also

Other formating functions: combine.data.frame(), combine.data(), eMoF.to.wideTable(), wideTable.to.eMoF()

Examples

1
2
3
4
## Not run: 
wideTab.to.hierarchicalTab(dataset=test_MIxS)

## End(Not run)

biodiversity-aq/OmicsMetaData documentation built on Dec. 19, 2021, 9:44 a.m.