Learn R Programming

quanteda (version 1.1.1)

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

x

corpus, tokens or dfm

groups

names of docvars or vector that can be coerced to a factor

Value

a factor