Learn R Programming

qdap (version 1.3.5)

all_words: Searches Text Column for Words

Description

A convenience function to find words that begin with or contain a letter chunk and returns the frequency counts of the number of occurrences of each word.

Usage

all_words(text.var, begins.with = NULL, contains = NULL,
  alphabetical = TRUE, apostrophe.remove = FALSE, ...)

Arguments

text.var
The text variable.
begins.with
This argument takes a word chunk. Default is NULL. Use this if searching for a word beginning with the word chunk.
contains
This argument takes a word chunk. Default is NULL. Use this if searching for a word containing the word chunk.
alphabetical
logical. If TRUE orders rows alphabetically, if FALSE orders the rows by descending frequency.
apostrophe.remove
logical. If TRUE removes apostrophes from the text before examining.
...
Other argument supplied to strip.

Value

  • Returns a dataframe with frequency counts of words that begin with or contain the provided word chunk.

See Also

term_match

Examples

Run this code
x1 <- all_words(raj$dialogue, begins.with="re")
head(x1, 10)
x2 <- all_words(raj$dialogue, "q")
head(x2, 10)
all_words(raj$dialogue, contains="conc")
x3 <- all_words(raj$dialogue)
head(x3, 10)

Run the code above in your browser using DataLab