Learn R Programming

textTools (version 0.1.0)

str_counts: Create a list of a vector of unique words found in x and a vector of the counts of each word in x.

Description

Create a list of a vector of unique words found in x and a vector of the counts of each word in x.

Usage

str_counts(x)

Arguments

x

A vector of words.

Value

A list, position one is a vector of unique and sorted words from x, position two is a vector of the counts for each word.

Examples

Run this code
# NOT RUN {
str_counts(
x = c("a", "dog", "went", "to", "the", "store", "and", "a", "dog", "went", "to", "another", "store")
)
# }

Run the code above in your browser using DataLab