plot.emotion: Plots a emotion object

Description Usage Arguments Details Value

View source: R/emotion.R

Description

Plots a emotion object.

Usage

1
2
3
4
5
6
7
8
## 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.


sentimentr documentation built on Oct. 12, 2021, 9:06 a.m.