str_split_col {dataMojo}R Documentation

Split one column to multiple columns based on patterns

Description

Split one column to multiple columns based on patterns

Usage

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

data("dt_dates")
str_split_col(dt_dates,
              by_col = "Full_name",
              by_pattern = ", ",
              match_to_names = c("First Name", "Last Name"))

[Package dataMojo version 1.0.0 Index]