Split runs of consecutive characters.
split_run(x, ...)# S3 method for default
split_run(x, ...)
# S3 method for data.frame
split_run(x, text.var = TRUE, ...)
A data.frame
or character vector with runs.
The name of the text variable with runs. If TRUE
split_word
tries to detect the text column with runs.
Ignored.
Returns a list of vectors of runs or an expanded
data.table
with runs split apart.
# NOT RUN {
x1 <- c(
"122333444455555666666",
NA,
"abbcccddddeeeeeffffff",
"sddfg",
"11112222333"
)
x <- c(rep(x1, 2), ">>???,,,,....::::;[[")
split_run(x)
DATA[["run.col"]] <- x
split_run(DATA, "run.col")
# }
Run the code above in your browser using DataLab