generate_groups: Generate a grouping vector from docvars
Description
Internal function to generate a grouping vector from docvars used in
dfm.corpus, dfm.tokens, dfm.group, and tokens_group
Usage
generate_groups(x, groups, drop = FALSE)
Arguments
groups
names of docvars or vector that can be coerced to a factor