plotSentiment {SentimentAnalysis} | R Documentation |
Line plot with sentiment scores
Description
Simple line plot to visualize the evolvement of sentiment scores. This is especially helpful when studying a time series of sentiment scores.
Usage
plotSentiment(
sentiment,
x = NULL,
cumsum = FALSE,
xlab = "",
ylab = "Sentiment"
)
Arguments
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"). |
Value
Returns a plot of class ggplot
See Also
plotSentimentResponse
and plot.SentimentDictionaryWeighted
for further plotting options
Examples
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()
[Package SentimentAnalysis version 1.3-5 Index]