plot.attributions: Plot prediction attributions at specified level

Description Usage Arguments Details Value Author(s)

View source: R/attribution.R

Description

Shows a plot of the attributions along the dimension provided, stacked per date.

Usage

1
2
## S3 method for class 'attributions'
plot(x, group = "features", ...)

Arguments

x

an attributions object created with attributions.

group

a value from c("lags", "lexicons", "features", "time").

...

not used.

Details

See sento_model for an elaborate modeling example including the calculation and plotting of attributions. This function does not handle the plotting of the attribution of individual documents, since there are often a lot of documents involved and they appear only once at one date (even though a document may contribute to predictions at several dates, depending on the number of lags in the time aggregation).

Value

Returns a simple ggplot object, which can be added onto (or to alter its default elements) by using the + operator. By default, a legend is positioned at the top if the number of components of the dimension is at maximum twelve.

Author(s)

Samuel Borms, Keven Bluteau


sentometrics documentation built on Aug. 18, 2021, 9:06 a.m.