Description Usage Arguments Value Initial Functions Examples
A pollyvote container is a list containing all the information that is
needed to predict an election. This is the central construct of this package
around which all other functions are centered.
A pollyvote container stores all relevant data and aggregation functions.
New data can be added using add_data
, election results can be
added using add_election_result
.
A pollyvote container can be
predicted (predict.pollyvote
) and its prediction error can be
calculated (error_calc.pollyvote
).
An overview over the out-of-the-box predictions and error calculation functions
is given in the section Initial Functions
. These initial functions are
not meant to be used directly, but only through
predict(pv, method = "initial_prediction_...")
.
New prediction methods and error calculcation methods can be added to a pollyvote
object using add_prediction.pollyvote
and add_error_calc.pollyvote
.
The predictions and error calculations can also be plotted using
plot.pollyvote
.
1 2 3 4 5 | create_pollyvote(id = "pollyvote", perm_countries = character(0),
perm_sources = character(0), perm_source_types = character(0),
perm_elections = character(0), perm_date_earliest = NULL,
perm_date_latest = NULL, perm_regions = character(0),
perm_region_types = character(0), perm_parties = character(0))
|
id |
[ |
perm_countries, perm_sources, perm_source_types, perm_elections, perm_regions, perm_region_types, perm_parties |
[ |
perm_date_earliest, perm_date_latest |
[ |
object of class pollyvote, containing an id, an initially empty data frame and potentially permissible values for the entries of the data frame.
some useful prediction, aggregation and error calculation functions are already
initialized when calling create_pollyvote()
.
These are:
prediction functions
'pollyvote': initial_prediction_pollyvote
'aggr_source_type': initial_prediction_aggr_source_type
error calculations:
'prediction_election': initial_error_calc_prediction_election
1 2 | pv = create_pollyvote(perm_countries = "D")
pv
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.