Sentiment Data and Plot
Arguments
- sentiment_dat
Sentiment dataframe created with [tm_sentiment()].
- colors
Colors (in order) for the sentiment chart.
- max_words
Numeric vector. Maximum number of words (`default = 100`).
- same_colors
Logical. Should the titles have the same colors as the words (`default = TRUE`)?
- title_size
Numeric vector. Size of the title (`default = 2`).
- scale
Numeric vector. Range of the size of the words (`default = c(5,1)`).
Examples
library(janeaustenr)
library(ggplot2)
library(dplyr)
df <-
austen_books() %>%
filter(book == "Sense & Sensibility")
dat <- tm_sentiment(df, "text")
tm_sentiment_plot(dat)