dict_translate: Relabels a wide data2d data.table

Description Usage Arguments Value Examples

Description

Relabels the columns of a wide data2d data.table (as generated by the selectTable function in ccdata). Because this uses the data.table::setnames function then the name changes happen 'in place' and nothing is returned

Usage

1
dict_translate(dict, value.a, label.in, label.out)

Arguments

dict

defaults to ITEM_REF

label.in

name for the item to be translated

label.out

name of the item to be used for the new column name

dt

data.table to be relabelled

Value

0 (if the function completes)

Examples

1
2
3
4
# use the ITEM_REF dictionary (not run)
# relabel_cols(tdt, "dataItem", "shortName")
# use a custom dictionary (not run)
# relabel_cols(tdt, "dataItem", "shortName", dict=analysis.dict)

docsteveharris/ccfun documentation built on May 15, 2019, 9:42 a.m.