Learn R Programming

proporz (version 1.5.2)

weight_votes_matrix: Create weighted votes matrix

Description

Weight votes by dividing the votes matrix entries by the number of seats per district. This method is used in upper_apportionment() if weight_votes is TRUE (default).

Usage

weight_votes_matrix(votes_matrix, district_seats)

weight_list_votes(votes_matrix, district_seats)

Value

the weighted votes_matrix which contains the number of voters (not rounded)

Arguments

votes_matrix

votes matrix

district_seats

seats per district, vector with same length as ncol(votes_matrix) and names as colnames(votes_matrix)

Examples

Run this code
weight_votes_matrix(uri2020$votes_matrix, uri2020$seats_vector)

Run the code above in your browser using DataLab