This function create word clouds and topic fugures
topicsPlot(
model = NULL,
ngrams = NULL,
test = NULL,
p_threshold = 0.05,
color_scheme = "default",
scale_size = FALSE,
plot_topics_idx = NULL,
save_dir,
figure_format = "svg",
width = 10,
height = 8,
max_size = 10,
seed = 42,
scatter_legend_dot_size = 15,
scatter_legend_bg_dot_size = 9,
scatter_legend_n = c(1, 1, 1, 1, 0, 1, 1, 1, 1),
scatter_legend_method = c("mean"),
scatter_legend_specified_topics = NULL,
scatter_legend_topic_n = FALSE,
grid_legend_title = "legend_title",
grid_legend_title_size = 5,
grid_legend_title_color = "black",
grid_legend_x_axes_label = "legend_x_axes_label",
grid_legend_y_axes_label = "legend_y_axes_label",
grid_legend_number_color = "black",
grid_legend_number_size = 5
)
(list) A trained topics model. For examples from topicsModel(). Should be NULL if plotting ngrams.
(list) The output from the the topicsGram() function . Should be NULL if plotting topics.
(list) The test results; if plotting according to dimension(s) include the object from topicsTest() function.
(integer) The p-value threshold to use for significance testing.
(string 'default' or vector) The color scheme.
For plots not including a test, the color_scheme should in clude 2 colours (1 gradient pair), such as:
c("lightgray", "darkblue)
For 1 dimensional plots of n-grams it should contain 4 colours (2 gradient pairs), such as:
c( "#EAEAEA", "darkred", # negative ngrams colors
"#EAEAEA", "darkgreen" # positve ngrams colors)
For 1-dimension plots of topics, it should contain 6 colours (3 gradient pairs), such as
c( "#EAEAEA", "darkred", # negative topics colors
"#EAEAEA", "darkgray", # colours of topics not significantly associated
"#EAEAEA", "darkgreen" # positve topics colors)
For 2-dimensional plots of topics, the color scheme should contain 18 colours (9 gradient pairs), such as:
c( "lightgray", "#398CF9", # quadrant 1 (upper left corner)
"lightgray", "#60A1F7", # quadrant 2
"lightgray", "#5dc688", # quadrant 3 (upper right corner)
"lightgray", "#e07f6a", # quadrant 4
"lightgray", "darkgray", # quadrant 5 (middle square)
"lightgray", "#40DD52", # quadrant 6
"lightgray", "#FF0000", # quadrant 7 (bottom left corner)
"lightgray", "#EA7467", # quadrant 8
"lightgray", "#85DB8E") # quadrant 9 (bottom right corner)
(logical) Whether to scale the size of the words.
(vector) The index or indeces of the topics to plot (e.g., look in the model-object for the indices; can for example, be c(1, 3:5) to plot topic t_1, t_3, t_4 and t_5) (optional).
(string) The directory to save the plots.
(string) Set the figure format, e.g., ".svg", or ".png".
(integer) The width of the topic (units = "in").
(integer) The width of the topic (units = "in").
(integer) The max size of the words.
(integer) The seed to set for reproducibility
(integer) The size of dots in the scatter legend.
(integer) The size of background dots in the scatter legend.
(numeric or vector) A vector determining the number of dots to emphasis in each quadrant of the scatter legend. For example: c(1,1,1,1,0,1,1,1,1) result in one dot in each quadrant except for the middle quadrant.
(string) The method to filter topics to be emphasised in the scatter legend. Can be either "mean", "max_x", or "max_y"
(vector) Specify which topic(s) to be emphasised in the scatter legend. For example c("t_1", "t_2"). If set, scatter_legend_method will have no effect.
(boolean) Allow showing the topic number or not in the scatter legend
The title of grid topic plot.
The size of the title of the plot.
The color of the legend title.
The label of the x axes.
The label of the y axes.
The color in the text in the legend.
The color in the text in the legend.
The function saves figures in the save_dir.