Skip to contents

Applies rename_vec (a named character vector old -> new) to dt using data.table::setnames(). Only renames entries where the old name actually exists in dt; silently skips the rest so this function is safe to call with a rename_vec built from a different dataset.

Usage

.apply_renames(dt, rename_vec)

Arguments

dt

A data.table (modified by reference).

rename_vec

Named character vector from match_result$rename_vec.

Value

dt invisibly (modification is in-place).