Learn R Programming

splitstackshape (version 1.4.0)

concat.split.compact: Split Concatenated Cells into a Condensed Format

Description

The default splitting method for concat.split. Formerly based on read.concat but presently a simple wrapper for cSplit..

Usage

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

Arguments

data
The source data.frame or data.table
split.col
The variable that needs to be split (either name or index position).
sep
The character separating each value.
drop
Logical. Should the original variable be dropped? Defaults to FALSE.
fixed
Logical. Should the split character be treated as a fixed pattern (TRUE) or a regular expression (FALSE)? Defaults to TRUE.
...
optional arguments to pass to cSplit.

Value

  • A data.table.

See Also

read.concat, cSplit

Examples

Run this code
temp <- head(concat.test)
concat.split.compact(temp, "Likes")
concat.split.compact(temp, 4, ";")

## Extra arguments to cSplit
concat.split.compact(temp, "Siblings", drop = TRUE, stripWhite = TRUE)

rm(temp)

Run the code above in your browser using DataLab