str_split_col: Split one column to multiple columns based on patterns

Description Usage Arguments Value Examples

View source: R/col_str_reshape.R

Description

Split one column to multiple columns based on patterns

Usage

1
str_split_col(dt, by_col, by_pattern, match_to_names = NULL)

Arguments

dt

input data table

by_col

by this column

by_pattern

split by this patter

match_to_names

created new columns names

Value

data table with new columns

Examples

1
2
3
4
5
data("dt_dates")
str_split_col(dt_dates,
              by_col = "Full_name",
              by_pattern = ", ",
              match_to_names = c("First Name", "Last Name"))

jienagu/dtverse documentation built on Aug. 15, 2020, 12:40 a.m.