all_words: Searches Text Column for Words

Description Usage Arguments Value Note See Also Examples

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

1
2
  all_words(text.var, begins.with = NULL, contains = NULL,
    alphabetical = TRUE)

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 frequency.

Value

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

Note

Cannot provide both begins.with and contains arguments at once. If both begins.with and contains are NULL all.words returns a frequency count for all words.

See Also

term.match

Examples

1
2
3
4
5
6
7
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)

trinker/qdap2 documentation built on May 31, 2019, 9:47 p.m.