Description Usage Arguments Value Examples
Adds a prediction, so far only implemented for pollyvote objects.
1 | add_prediction(pv, method, fun = function(pv) { get_data(pv) }, ...)
|
pv |
[ |
method |
[ |
fun |
[ |
... |
additional arguments |
The pollyvote object with added prediction.
1 2 3 4 5 6 7 8 | pv = create_pollyvote(perm_countries = "D")
pv = add_prediction(pv, "poll", function(pv) {
pv %>%
get_data %>%
filter(source_type %in% c("poll")) %>%
group_by(date, source_type, party) %>%
summarize(percent = mean(percent, na.rm = TRUE))
})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.