plot.pollyvote: plot a pollyvote object

Description Usage Arguments Value Examples

Description

plots a prediction or error calculation of a pollyvote object. Internally, either predict.pollyvote or error_calc.pollyvote are called and plotted using ggplot2.

Usage

1
2
3
## S3 method for class 'pollyvote'
plot(x, .prediction_method = NULL,
  .error_calc_method = NULL, ...)

Arguments

x

[pollyvote(1)]
pollyvote object to predict from.

.prediction_method

[character(1)]
method of the prediction to be plotted.

.error_calc_method

[character(1)]
method of the error calculation to be plotted. Note that only one of prediction_method and error_calc_method can be specified.

...

additional arguments to the predict or error_calc_method function. Most commonly used might be ci = TRUE if .error_calc_method is specified.

Value

a ggplot object that can be further modified.

Examples

1
2
3
4
5
pv = create_pollyvote(perm_countries = "D")
data("polls_individual")
pv = add_data(pv, newdata = polls_individual, country = "D", region = "national", 
              source_type = "poll", election = "BTW")
p <- plot(pv, .prediction_method = "pollyvote")

pollyvote/pollyvoter documentation built on May 25, 2019, 11:23 a.m.