plot.emotion {sentimentr}R Documentation

Plots a emotion object

Description

Plots a emotion object.

Usage

## S3 method for class 'emotion'
plot(
  x,
  transformation.function = syuzhet::get_dct_transform,
  drop.unused.emotions = TRUE,
  facet = TRUE,
  ...
)

Arguments

x

The emotion object.

transformation.function

A transformation function to smooth the emotion scores.

drop.unused.emotions

logical. If TRUE unused/unfound emotion levels will not be included in the output.

facet

logical or one of c('emotion', 'negated'). If TRUE or 'emotion' the plot will be facetted by Emotion Type. If FALSE all types will be plotted in the same window. If "negated" the emotions will be in the same plot window but broken out by negated or non-negated types.

...

Other arguments passed to get_transformed_values.

Details

Utilizes Matthew Jocker's syuzhet package to calculate smoothed emotion across the duration of the text.

Value

Returns a ggplot2 object.


[Package sentimentr version 2.9.0 Index]