mergeAndFillCols: Merge and Fill Columns

View source: R/mergeAndFillCols.R

mergeAndFillColsR Documentation

Merge and Fill Columns

Description

Takes >= 2 columns with overlapping, incomplete data and merges them into 1 column.

Usage

mergeAndFillCols(
  data_dt,
  toMerge_v,
  outName_v = "merged",
  search_lsv = NULL,
  replace_lsv = NULL,
  check_v = T
)

Arguments

data_dt

data.table with values

toMerge_v

vector of column names that should be merged

outName_v

name of the resulting merged column. Default is 'merged'.

search_lsv

list of values to search for within the columns. This is done before merge. One example is the 'age' columns that have KJ in them. Can search for those and replace with NA to take the value in the other column.

replace_lsv

list of values to replace. Each element must match with search_lsv

check_v

logical. TRUE (default) check new column accuracy by searching for '_'; FALSE - don't check


weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.