lookup_and_replace: Look up and replace values in columns, including list...

Description Usage Arguments Value

Description

Replace all values in a data.frame using a lookup table. Maximum of one list column can be include in cols_to_lookup.

Usage

1
lookup_and_replace(data, lookup_table, cols, id_col = NULL)

Arguments

data

a data.table/data.frame to be replaced.

lookup_table

a data.table/data.frame contains two columns which must be named as .key and value. The reason for requiring a dot infront of key is that key is a reserved column name in data.table meaning no columns can be named key. Also the .key column should have the same data type as cols_to_lookup columns.

cols

column names to be lookup and replace

id_col

a column with unique value to be used in unnesting data. This is not required if cols_to_lookup doesn't contain any list columns.

Value

data.table with new values


dymium-org/dymiumCore documentation built on July 18, 2021, 5:10 p.m.