term_count: Search For and Count Terms

Description Usage Arguments Value

View source: R/term_count.R

Description

term_count - Search a string by any number of grouping variables for categories (themes) of grouped root terms/substrings.

Usage

1
2
term_count(text.var, grouping.var = NULL, term.list, ignore.case = TRUE,
  pretty = ifelse(isTRUE(grouping.var), FALSE, TRUE), group.names, ...)

Arguments

text.var

The text string variable.

grouping.var

The grouping variable(s). Default NULL generates one word list for all text. Also takes a single grouping variable or a list of 1 or more grouping variables. If TRUE an id variable is used with a seq_along the text.var.

term.list

A list of named character vectors. 'codeterm_count can be used in a hierarchical fashion as well; that is a list of regexes can be passed and counted and then a second (or more) pass can be taken wit a new set of regexes on only those rows/text elements that were left untagged (count rowSums is zero). This is accomplished by passing a list of lists of regexes. See Examples for the hierarchical terms section for a demonstration.

ignore.case

logical. If FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching.

pretty

logical. If TRUE pretty printing is used. Pretty printing can be turned off globally by setting options(termco_pretty = FALSE).

group.names

A vector of names that corresponds to group. Generally for internal use.

...

ignored.

Value

Returns a tbl_df object of term counts by grouping variable.


trinker/termcoLite documentation built on Oct. 23, 2021, 9:53 a.m.