annotation_heatmap | R Documentation |
This is a generic plotting utility (not specific to topic the model) for comparing “effects” across multiple dimensions (e.g., topics). The function has several options for selecting the features to compare.
annotation_heatmap(
effects_matrix,
select_features = c("largest", "distinctive", "both", "all"),
feature_sign = c("both", "positive", "negative"),
dims = colnames(effects_matrix),
compare_dims = colnames(effects_matrix),
n = 2,
show_dims = colnames(effects_matrix),
zero_value = 0.01,
font_size = 10,
verbose = TRUE
)
effects_matrix |
n x d numeric matrix, where n is the number
of features and d is the number of dimensions. This could be for
example the word frequencies matrix |
select_features |
This may be a character vector specifying
the features to plot (rows of the effects matrix). Or it may be one
of the following: |
feature_sign |
For automated selection of features, this
option determines whether to consider positive effects only
( |
dims |
The dimensions (columns of the effect matrix) to consider for automatic feature selection. This should be dimension names (not numbers). |
compare_dims |
This should be dimension names (not numbers). |
n |
For automated feature selection, the number of features to
select of each type and for each dimension. (see arguments
|
show_dims |
The dimensions (columns) to include in the plot. This should be dimension names (not numbers). |
zero_value |
Numbers smaller than |
font_size |
Specifies the font size for the plot. |
verbose |
When |
A ggplot
object.
data(newsgroups)
p1 <- annotation_heatmap(newsgroups$F,feature_sign = "positive")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.