split_run: Split Runs

Description Usage Arguments Value Examples

View source: R/split_run.R

Description

Split runs of consecutive characters.

Usage

1
2
3
4
5
6
7
split_run(x, ...)

## Default S3 method:
split_run(x, ...)

## S3 method for class 'data.frame'
split_run(x, text.var = TRUE, ...)

Arguments

x

A data.frame or character vector with runs.

text.var

The name of the text variable with runs. If TRUE split_word tries to detect the text column with runs.

...

Ignored.

Value

Returns a list of vectors of runs or an expanded data.table with runs split apart.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
x1 <- c(
     "122333444455555666666",
     NA,
     "abbcccddddeeeeeffffff",
     "sddfg",
     "11112222333"
)

x <- c(rep(x1, 2), ">>???,,,,....::::;[[")

split_run(x)


DATA[["run.col"]] <- x
split_run(DATA, "run.col")

textshape documentation built on May 29, 2021, 1:07 a.m.