set.new_row_per_string_item: Create new data.table rows for each combination of first and...

Description Usage Arguments Examples

View source: R/dataset.R

Description

Create new data.table rows for each combination of first and last name

Usage

1
2
set.new_row_per_string_item(single_row_dt, fname_col, lname_col,
  delims = "[-, ]")

Arguments

single_row_dt

Data.table with one row/record.

fname_col

First name column name.

lname_col

Last name column name.

delims

Delimters to split string by.

Examples

1
2
3
4
5
6
7
8
dt <-
data.table(
  id = c(1, 2),
  fname = c("Aaron David", "Blaine-Myers"),
  lname = c("Schroeder-Dingdong", "Dingbat Tumbleweed"),
  dob = "11/13/1968"
)
final_dt <- dt[, set.new_row_per_string_item(.SD, fname_col = "fname", lname_col = "lname"), id]

dads2busy/dataplumbr documentation built on July 2, 2021, 3:24 a.m.