quanteda (version 1.3.4)

groups: Grouping variable(s) for various functions

Description

Groups for aggregation by various functions that take grouping options. Groups can be the name(s) of document variables (as a character vector), or variables whose length or number of rows (if a data.frame) equal the number of documents.

Arguments

groups

either: a character vector containing the names of document variables to be used for grouping; or a factor or object that can be coerced into a factor equal in length or rows to the number of documents. See groups for details.