Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rainette_plot

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"),
  show_negative = TRUE,
  text_size = NULL
)

Arguments

res

result object of a rainette clustering

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

Value

A gtable object.

See Also

Examples

library(quanteda)
corpus <- data_corpus_inaugural
corpus <- head(corpus, n = 10)
corpus <- split_segments(corpus)
dtm <- dfm(corpus, remove = stopwords("en"), tolower = TRUE, remove_punct = TRUE)
dtm <- dfm_trim(dtm, min_termfreq = 3)
res <- rainette(dtm, k = 3)
rainette_plot(res, dtm)

rainette

The Reinert Method for Textual Data Clustering

v0.1.3
GPL (>= 3)
Authors
Julien Barnier [aut, cre], Florian Privé [ctb]
Initial release
2021-05-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.