apportion: Calculate U.S. congressional apportionment.

Description Usage Arguments Details Value

View source: R/apportion.R

Description

apportion() simulates U.S. congressional apportionment with a state-level population data set you provide.

Usage

1
2
3
apportion(pop_data, total_seats = 435, apportion_year = NULL,
  DC_seats = FALSE, PR_seats = FALSE, GU_seats = FALSE, min_seats = 1,
  store_priority = FALSE, store_seat_order = FALSE)

Arguments

pop_data

A data frame of population values for each state. State names will be internally coerced to uppercase.

total_seats

The total number of voting seats in the hypothetical congress. This number was fixed at the default (435) in 1911.

apportion_year

A character string (or coercible) indicating the year of apportionment to simulate. For now, this parameter affects only the number of states in the union, not the apportionment method, so you're better off just supplying pop_data with population values for only the states in which you're interested.

DC_seats

A logical indicating whether to allocate voting seats to Washington, D.C.

PR_seats

A logical indicating whether to allocate voting seats to Puerto Rico.

GU_seats

A logical indicating whether to allocate voting seats to Guam.

min_seats

The minimum (starting) number of seats per state. The default is 1.

store_priority

A logical indicating whether to store the priority scores calculated for each state-seat combination. Scores are stored as a wide data.table object named priority_scores in the enclosing environment,

store_seat_order

A logical indicating whether to store state names in the order that seats were allocated. The seat order is stored as a character vector named seat_order in the enclosing environment.

Details

Currently, apportion() can implement only the https://www.census.gov/population/apportionment/about/computing.htmlmethod of equal proportions. This method has been used since 1941. Support for obsolete methods may be added later.

Value

A two-column data.table containing the name of each state and the number of seats allocated to it.


coletl/congappor documentation built on May 20, 2019, 3:06 p.m.