plot.SentimentDictionaryWeighted: KDE plot of estimated coefficients

View source: R/plot.R

plot.SentimentDictionaryWeightedR 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 SentimentDictionaryWeighted

color

Color for filling the density plot (default: gray color)

theme

Visualization theme for ggplot (default: is a black-white theme)

...

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() 

SentimentAnalysis documentation built on Aug. 24, 2023, 1:07 a.m.