str_split_col: Split one column to multiple columns based on patterns

View source: R/col_str_reshape.R

str_split_colR 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"))

dataMojo documentation built on March 7, 2023, 8:10 p.m.