Skip to contents

This is a convenience function for M[!quorum_vector, ] <- 0L. Used in combination with eval_quorum() in upper_apportionment().

Usage

zero_failed_quorum(M, quorum_vector)

Arguments

M

votes or voter matrix

quorum_vector

logical vector with length equal to nrow(M).

Value

M with party rows set to zero

See also

Examples

(vm <- matrix(c(30, 20, 20, 50), 2))
#>      [,1] [,2]
#> [1,]   30   20
#> [2,]   20   50
(b <- eval_quorum(quorum_any(votes_any_district = 40), vm))
#> [1] FALSE  TRUE

zero_failed_quorum(vm, b)
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]   20   50