Learn R Programming

splitstackshape (version 1.4.8)

read.concat: Read Concatenated Character Vectors Into a data.frame

Description

Originally a helper function for the concat.split.compact() function. This function has now been effectively replaced by cSplit().

Usage

read.concat(data, col.prefix, sep, ...)

Arguments

data

The input data.

col.prefix

The desired column prefix for the output data.frame.

sep

The character that acts as a delimiter.

Other arguments to pass to utils::read.table().

Value

A data.frame.

See Also

utils::read.table()

Examples

Run this code
# NOT RUN {
vec <- c("a,b", "c,d,e", "f, g", "h, i, j,k")
splitstackshape:::read.concat(vec, "var", ",")

## More than 5 lines the same
## `read.table` would fail with this
vec <- c("12,51,34,17", "84,28,17,10", "11,43,28,15",
"80,26,17,91", "10,41,25,13", "97,35,23,12,13")
splitstackshape:::read.concat(vec, "var", ",")

# }

Run the code above in your browser using DataLab