View source: R/plot_alignment.R
plot_alignment | R Documentation |
This function creates flow diagrams of alignment weight across collections of topics. It is the default plot method associated with alignment objects. The x-axis indexes models from those with few to those with many topics. Each rectangle matches a topic; its height is the weight associated with that topic from across all samples. The width of edges between topics corresponds of the alignment weight between that pair of topics. By default, topics are shaded according to their path. Other topic measures can be provided by modifying the 'color_by' argument.
plot_alignment(
x,
rect_gap = 0.2,
color_by = "path",
model_name_repair_fun = paste0,
label_topics = FALSE,
add_leaves = FALSE,
leaves_text_size = 10,
n_features_in_leaves = 3,
min_feature_prop = 0.1,
top_n_edges = NULL
)
x |
(required) An alignment class object resulting from
|
rect_gap |
(optional) A float describing how much vertical space to put between topics within the same model. The units correspond to topic masses. Defaults to 0.2. |
color_by |
(optional) What should the color of topics and weights encode? Defaults to 'path'. Other possible arguments are 'coherence', 'refinement', or 'topic'. |
model_name_repair_fun |
(optional) How should names be repaired before plotting? |
label_topics |
(optional, default = |
add_leaves |
(optional, default = |
leaves_text_size |
(optional, default = |
n_features_in_leaves |
(optional, default = 3) specifies the maximum
number of features that should be included in the leaves annotations
if |
min_feature_prop |
(optional, default = 0.1) specifies the minimum
proportion of a feature in a topic for that feature to be included in
the leaves annotations if |
top_n_edges |
(optional, |
A ggplot2
object describing the alignment weights across
models.
align_topics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.