plotSentimentResponse | R Documentation |
Generates a scatterplot where points pairs of sentiment and
the response variable. In addition, the plot addas a trend line
in the form of a generalized additive model (GAM). Other
smoothing variables are possible based on geom_smooth
.
This functions is helpful for visualization the relationship
between computed sentiment scores and the gold standard.
plotSentimentResponse(
sentiment,
response,
smoothing = "gam",
xlab = "Sentiment",
ylab = "Response"
)
sentiment |
|
response |
Vector with response variables of the same length |
smoothing |
Smoothing functionality. Default is |
xlab |
Description on x-axis (default: "Sentiment"). |
ylab |
Description on y-axis (default: "Sentiment"). |
Returns a plot of class ggplot
plotSentiment
and plot.SentimentDictionaryWeighted
for further plotting options
sentiment <- data.frame(Dictionary=runif(10))
response <- sentiment[[1]] + rnorm(10)
plotSentimentResponse(sentiment, response)
# Change x-axis
plotSentimentResponse(sentiment, response, xlab="Tone")
library(ggplot2)
# Extend plot with additional layout options
plotSentimentResponse(sentiment, response) + ggtitle("Scatterplot")
plotSentimentResponse(sentiment, response) + theme_void()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.