Plot sentiment grouped by a certain variable.
Arguments
- data
A data frame that includes the grouping and sentiment variables.
- group_var
The variable to group by. Default is "topic".
- sentiment_var
The sentiment variable. Default is "sentiment".
- plot_type
The type of plot. Default is "percent".
- bar_labels
The type of labels to display on bars. Default is "volume".
- sentiment_colours
Colour mapping for the sentiment categories
Examples
{
DisplayR::disp_example %>% dr_plot_sent_group(group_var = topic,
sentiment_var = sentiment,
plot_type = "percent",
bar_labels = "volume")
DisplayR::disp_example %>% dr_plot_sent_group(group_var = topic,
sentiment_var = sentiment,
plot_type = "volume",
bar_labels = "none")
}