Learn R Programming

splitstackshape (version 1.0)

concat.split.list: Split concatenated cells in a data.frame into a list format

Description

Takes a column in a data.frame with multiple values, splits the values into a list, and returns a new data.frame.

Usage

concat.split.list(data, split.col, sep = ",",
    drop = FALSE, fixed = FALSE)

Arguments

data
The source data.frame.
split.col
The variable that needs to be split (either name or index position).
sep
The character separating each value. Can also be a regular expression.
drop
Logical. Should the original variable be dropped? Defaults to FALSE.
fixed
Used for strsplit for allowing regular expressions to be used.

Value

  • A data.frame with the concatenated column split and added as a list.

See Also

concat.split, concat.split.compact, concat.split.expanded, concat.split.multiple

Examples

Run this code
temp <- head(concat.test)
str(concat.split.list(temp, "Likes"))
concat.split.list(temp, 4, ";")
concat.split.list(temp, 4, ";", drop = TRUE)

rm(temp)

Run the code above in your browser using DataLab