rainette_plot {rainette} | R Documentation |
Generate a clustering description plot from a rainette result
Description
Generate a clustering description plot from a rainette result
Usage
rainette_plot(
res,
dtm,
k = NULL,
type = c("bar", "cloud"),
n_terms = 15,
free_scales = FALSE,
measure = c("chi2", "lr", "frequency", "docprop"),
show_negative = FALSE,
text_size = NULL,
show_na_title = TRUE,
cluster_label = NULL,
keyness_plot_xlab = NULL
)
Arguments
res |
result object of a |
dtm |
the dfm object used to compute the clustering |
k |
number of groups. If NULL, use the biggest number possible |
type |
type of term plots : barplot or wordcloud |
n_terms |
number of terms to display in keyness plots |
free_scales |
if TRUE, all the keyness plots will have the same scale |
measure |
statistics to compute |
show_negative |
if TRUE, show negative keyness features |
text_size |
font size for barplots, max word size for wordclouds |
show_na_title |
if TRUE, show number of NA as plot title |
cluster_label |
define a specific term for clusters identification in keyness plots. Default is "Cluster" or "Cl." depending on the number of groups. |
keyness_plot_xlab |
define a specific x label for keyness plots. |
Value
A gtable object.
See Also
quanteda.textstats::textstat_keyness()
, rainette_explor()
, rainette_stats()
Examples
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)
rainette_plot(res, dtm)