df_split_col: Split string/factor column.

Description Usage Arguments Value

View source: R/df_split_col.R

Description

Given a data frame x, a column name and a naming scheme, the function splits every element in x[[split.col]], using the naming scheme. Next, either a data frame with column names indicating the split parts for each unique value in x[[split.col]] is returned, or, if append=TRUE, this data frame is left-joined with x by split.col.

Usage

1
df_split_col(x, split.col, scheme, delim, append = TRUE)

Arguments

x

[data.frame]
Source data frame.

split.col

[string]
Column name of column used for splitting.

scheme

[string]
Single string encoding the names and types of the split parts. E.g. “groupc/problemc_ni_mi/algorithmc_pcr”. Passed down to decode_scheme.

delim

[character]
Set of characters used to split the entries in the column.

append

[logical(1)]
Should the splitted data be appended to x by split.col? Default is FALSE.

Value

[data.frame]


jakobbossek/tblutils documentation built on March 13, 2021, 12:47 p.m.