MyNixOS website logo
Description

Apportion Seats.

Convert populations into integer number of seats for legislative bodies. Implements apportionment methods used historically and currently in the United States for reapportionment after the Census, as described in <https://www.census.gov/history/www/reference/apportionment/methods_of_apportionment.html>.

apportion

R-CMD-check

apportion provides different apportionment methods for allocating seats across states. These methods are also sometimes used for allocating seats by votes in proportional representation systems.

Installation

You can install the development version of apportion like so:

remotes::install_github('christopherkenny/apportion')

Example

apportion has several apportionment methods, each of which take two required arguments: - size: the number of seats to apportion across units - pop: a vector of population sizes for each unit

library(apportion)
## basic example code
data('state_2020')

app_adams(size = 435, pop = state_2020$pop)
#>  [1]  7  1  9  4 50  8  5  2 27 14  2  3 16  9  4  4  6  6  2  8  9 13  8  4  8
#> [26]  2  3  4  2 12  3 26 14  1 15  5  6 17  2  7  2  9 37  5  1 11 10  3  8  1

Implemented methods include:

  • the Adams Method (app_adams())
  • the Balinski Young Method (app_balinski_young())
  • the Dean Method (app_dean())
  • the D’Hondt Method (app_dhondt())
  • the Hamilton-Vinton Method (app_hamilton_vinton())
  • the Huntington-Hill Method (app_huntington_hill())
  • the Jefferson Method (app_jefferson())
  • the Webster Method (app_webster())
Metadata

Version

0.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD 13
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows