textshape (version 1.6.0)

split_word: Split Words

Description

Split words.

Usage

split_word(x, ...)

# S3 method for default split_word(x, lower = TRUE, ...)

# S3 method for data.frame split_word(x, text.var = TRUE, lower = TRUE, ...)

Arguments

x

A data.frame or character vector with words.

lower

logical. If TRUE the words are converted to lower case.

text.var

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

Ignored.

Value

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

Examples

Run this code
# NOT RUN {
(x <- c(
    "Mr. Brown comes! He says hello. i give him coffee.",
    "I'll go at 5 p. m. eastern time.  Or somewhere in between!",
    "go there"
))
split_word(x)
split_word(x, lower=FALSE)

data(DATA)
split_word(DATA)
split_word(DATA, lower=FALSE)

## Larger data set
split_word(hamlet)
# }

Run the code above in your browser using DataLab