View source: R/textstat-methods.R
textstat_select | R Documentation |
Users can subset output object of textstat_collocations
,
textstat_keyness
or textstat_frequency
based on
"glob"
, "regex"
or "fixed"
patterns using this method.
textstat_select(
x,
pattern = NULL,
selection = c("keep", "remove"),
valuetype = c("glob", "regex", "fixed"),
case_insensitive = TRUE
)
x |
a |
pattern |
see quanteda::pattern |
selection |
whether to |
valuetype |
the type of pattern matching: |
case_insensitive |
logical; if |
library("quanteda")
period <- ifelse(docvars(data_corpus_inaugural, "Year") < 1945, "pre-war", "post-war")
dfmat <- tokens(data_corpus_inaugural) %>%
dfm() %>%
dfm_group(groups = period)
tstat <- textstat_keyness(dfmat)
textstat_select(tstat, 'america*')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.