View source: R/plot_group_sentiment.R
plot_group_sentiment | R Documentation |
Quickly plot group sentiment distributions as a perentage
plot_group_sentiment(
df,
group_var = topic,
sentiment_var = sentiment,
type = c("percent", "volume"),
title = "Grouped Sentiment Chart",
bar_labels = c("none", "percent", "volume")
)
df |
data frame |
group_var |
Grouping variable, e.g. country, topic, cluster |
sentiment_var |
Sentiment variable (categorical) |
type |
Whether the plot should be of volume or py percentage. Accepts "percent" or "volume" |
title |
The title of the plot, entered as a string. |
bar_labels |
Whether to add the raw volume, percentage or neither to the bars |
Ggplot stacked bar chart with x and y coords flipped
## Not run:
# Example 1:
plot_group_sentiment(df, group_var = platform, sentiment_var = sentiment, type = "percent")
# Example 2:
plot_group_sentiment(df, group_var = topic, sentiment_var = sentiment, type = "volume")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.