View source: R/set_new_row_per_string_item.R
set_new_row_per_string_item | R Documentation |
Create new data.table rows for each combination of first and last name
set_new_row_per_string_item( single_row_dt, fname_col, lname_col, delims = "[-, ]" )
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. |
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]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.