plot_poll: Plot a multiparty poll

Description Usage Arguments Value Warning Examples

View source: R/plotting.R

Description

...

Usage

1
2
3
4
5
6
plot_poll(vote = c(cdu = 0.33, spd = 0.2, fdp = 0.11, linke = 0.09,
  gruene = 0.09, afd = 0.12, sonstige = 0.05), order = "alphabetical",
  sample_confidence_bounds = TRUE, sample_n = 1000, n_draw = 10000,
  show_quantiles = c(0.05, 0.95), round = 1, xlab = "Party",
  ylab = "Voteshare", title = "Title", subtitle = "Subtitle",
  caption = "Caption", theme_ipsum = FALSE, grid = "Y")

Arguments

vote

A labeled party vote share vector.

order

Method to order parties (Default is "alphabetical"; also takes "descending" and "ascending" as well as manual specification of party vector)

sample_confidence_bounds

Logical T/F: add empirical dirichlet quantiles

sample_n

The number of observations in the poll sample.

n_draw

How many samples to draw from the dirichlet distribution.

show_quantiles

Vector of quantiles/confidence boundaries to calculate.

round

Round to k decimals after comma

xlab

x-label string

ylab

y-label string

title

title string

subtitle

subtitle string

caption

caption string

theme_ipsum

Pre-applies nice theme from the hrbrthemes-package.(Attention: possible font-issues when Roboto font is not installed on your computer.)

grid

(Applies only if theme_ipsum == T) Add a grid (options: "none","Y")

Value

A data frame containing n rows of samples for each party.

Warning

Do not operate heavy machinery within 8 hours of using this function.

Examples

1
sample_dirichlet_quantiles(vote = c(cdu = 0.33,....

schliebs/voteR documentation built on May 7, 2019, 3:33 p.m.