rainette_stats | R Documentation |
Generate cluster keyness statistics from a rainette result
rainette_stats(
groups,
dtm,
measure = c("chi2", "lr", "frequency", "docprop"),
n_terms = 15,
show_negative = TRUE,
max_p = 0.05
)
groups |
groups membership computed by |
dtm |
the dfm object used to compute the clustering |
measure |
statistics to compute |
n_terms |
number of terms to display in keyness plots |
show_negative |
if TRUE, show negative keyness features |
max_p |
maximum keyness statistic p-value |
A list with, for each group, a data.frame of keyness statistics for the most specific n_terms features.
quanteda.textstats::textstat_keyness()
, rainette_explor()
, rainette_plot()
require(quanteda)
corpus <- data_corpus_inaugural
corpus <- head(corpus, n = 10)
corpus <- split_segments(corpus)
tok <- tokens(corpus, remove_punct = TRUE)
tok <- tokens_remove(tok, stopwords("en"))
dtm <- dfm(tok, tolower = TRUE)
dtm <- dfm_trim(dtm, min_docfreq = 3)
res <- rainette(dtm, k = 3, min_segment_size = 15)
groups <- cutree_rainette(res, k = 3)
rainette_stats(groups, dtm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.