str_counts {textTools}R Documentation

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

str_counts(
x = c("a", "dog", "went", "to", "the", "store", "and", "a", "dog", "went", "to", "another", "store")
)

[Package textTools version 0.1.0 Index]