rainette (version 0.1.2)

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

quanteda::textstat_keyness(), rainette_explor(), rainette_stats()

Examples

Run this code
# NOT RUN {
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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab