krangl / krangl / separate

separate

fun DataFrame.separate(column: String, into: List<String>, sep: String = "[^\\w]", remove: Boolean = true, convert: Boolean = false): DataFrame

Given either regular expression or a vector of character positions, separate() turns a single character column into multiple columns.

Parameters

column - Bare column name.

into - Names of new variables to create as character vector.

sep - Separator between columns. If character, is interpreted as a regular expression. The default value is a regular @param expression that matches any sequence of non-alphanumeric values.

remove - If TRUE, remove input column from output data frame.

convert - If set, attempt to do a type conversion will be run on all new columns. This is useful if the value column was a mix of variables that was coerced to a string.