CT_to_long: Reshapes correspondence table from wide to long format....

Description Usage Arguments Value

View source: R/reshaping.R

Description

Reshapes correspondence table from wide to long format. Wrapper around data.table::melt

Usage

1
2
3
4
5
6
CT_to_long(
  x,
  source_name = "source",
  target_name = "target",
  sort_by = "source"
)

Arguments

x

a CT in wide format. Either matrix with rownames (source classification) and column names (target classfication), or data.table with the source classifaction as the first column

source_name

name of the source classication. Defaults to 'source' (if x is matrix), or the name of the first column (if x is data.table)

target_name

name of the target classifaction. Defaults to 'target'

sort_by

either 'source' (default) or 'target'

Value

a CT in long format (=data.table with 3 columns: source and target classification, and mapping infromation (numeric/boolean))


simschul/mapR documentation built on Dec. 24, 2021, 1:18 a.m.