add_regions: Adds the region weights to the pollyvote container.

Description Usage Arguments Value Examples

Description

Adds the region weights to the pollyvote container.

Usage

1
add_regions(pv, regions, weights = NULL)

Arguments

pv

[pollyvote]
the pollyvote object to add region weights to.

regions

[character(n)]
Vector of region names Region names are validated against the permitted regions in the pollyvote container.

weights

[numeric(n)]
Vector of region weights. If NULL, then all weights are assigned to 1 (Default value).

Value

the pollyvote object with added region weights

Examples

1
2
3
  pv = add_regions(pv, c("London", "Yorkshire"), c(0.7, 0.3))
  pv = add_regions(pv, c("London", "Yorkshire"))
  

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