| plot.SentimentDictionaryWeighted {SentimentAnalysis} | R Documentation |
KDE plot of estimated coefficients
Description
Function performs a Kernel Density Estimation (KDE) of the coefficients and then
plot these using ggplot. This type of plot allows to
inspect whether the distribution of coefficients is skew. This can reveal if there
are more positive terms than negative or vice versa.
Usage
## S3 method for class 'SentimentDictionaryWeighted'
plot(x, color = "gray60", theme = ggplot2::theme_bw(), ...)
Arguments
x |
Dictionary of class |
color |
Color for filling the density plot (default: gray color) |
theme |
Visualization theme for |
... |
Additional parameters passed to function. |
Value
Returns a plot of class ggplot
See Also
plotSentiment and plotSentimentResponse for further plotting options
Examples
d <- SentimentDictionaryWeighted(paste0(character(100), 1:100), rnorm(100), numeric(100))
plot(d)
# Change color in plot
plot(d, color="red")
library(ggplot2)
# Extend plot with additional layout options
plot(d) + ggtitle("KDE plot")
plot(d) + theme_void()
[Package SentimentAnalysis version 1.3-5 Index]