Description Usage Arguments Examples
Recombine documents tokens by groups
1 | tokens_group(x, groups = NULL, fill = FALSE)
|
x |
tokens object |
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.
|
1 2 3 4 5 6 7 | # dfm_group examples
corp <- corpus(c("a a b", "a b c c", "a c d d", "a c c d"),
docvars = data.frame(grp = c("grp1", "grp1", "grp2", "grp2")))
toks <- tokens(corp)
quanteda.core:::tokens_group(toks, groups = "grp")
quanteda.core:::tokens_group(toks, groups = c(1, 1, 2, 2))
quanteda.core:::tokens_group(toks, groups = factor(c(1, 1, 2, 2), levels = 1:3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.