concat.split.multiple: Split Concatenated Cells and Optionally Reshape the Output

Description Usage Arguments Value Author(s) See Also Examples

Description

This is a wrapper for the cSplit() function to maintain backwards compatibility with earlier versions of the "splitstackshape" package. It allows the user to split multiple columns at once and optionally convert the results into a "long" format.

Usage

1
2
concat.split.multiple(data, split.cols, seps = ",", direction = "wide",
  ...)

Arguments

data

The source data.frame or data.table.

split.cols

A vector of columns that need to be split.

seps

A vector of the separator character used in each column. If all columns use the same character, you can enter that single character.

direction

The desired form of the resulting data.frame or data.table, either "wide" or "long". Defaults to "wide".

...

Other arguments to cSplit().

Value

A data.table.

Author(s)

Ananda Mahto

See Also

cSplit()

Examples

1
2
3
4
5
6
7
8
## Not run: 
temp <- head(concat.test)
concat.split.multiple(temp, split.cols = c("Likes", "Hates", "Siblings"),
                      seps = c(",", ";", ","))
concat.split.multiple(temp, split.cols = c("Likes", "Siblings"),
                      seps = ",", direction = "long")

## End(Not run)

splitstackshape documentation built on May 1, 2019, 8:20 p.m.