get_mappings {cat2cat}R Documentation

Transforming table of mappings to a list with keys

Description

transforming table of mappings to list with keys where first column is assumed to be an old encoding.

Usage

get_mappings(x = data.frame())

Arguments

x

data.frame or matrix with 2 columns where first column is assumed to be an old encoding.

Details

the named list will be a more efficient solution than hash map as we are not expecting more than a few thousand keys.

Value

list with 2 fields 'to_old' 'to_new'

Examples

data(trans)

mappings <- get_mappings(trans)
mappings$to_old[1:4]
mappings$to_new[1:4]

[Package cat2cat version 0.2.1 Index]