plotSentiment | R Documentation |
Simple line plot to visualize the evolvement of sentiment scores. This is especially helpful when studying a time series of sentiment scores.
plotSentiment(
sentiment,
x = NULL,
cumsum = FALSE,
xlab = "",
ylab = "Sentiment"
)
sentiment |
|
x |
Optional parameter with labels or time stamps on x-axis. |
cumsum |
Parameter deciding whether the cumulative sentiment
is plotted (default: |
xlab |
Name of x-axis (default: empty string). |
ylab |
Name of y-axis (default: "Sentiment"). |
Returns a plot of class ggplot
plotSentimentResponse
and plot.SentimentDictionaryWeighted
for further plotting options
sentiment <- data.frame(Dictionary=runif(20))
plotSentiment(sentiment)
plotSentiment(sentiment, cumsum=TRUE)
# Change name of x-axis
plotSentiment(sentiment, xlab="Tone")
library(ggplot2)
# Extend plot with additional layout options
plotSentiment(sentiment) + ggtitle("Evolving sentiment")
plotSentiment(sentiment) + theme_void()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.