(vm = matrix(c(60,30,0,20,10,30), nrow = 3, dimnames = list(1:3, c("A", "B"))))
district_winner_matrix(vm)
# NA values if parties are tied (here in district B)
vm[1,2] <- 30
district_winner_matrix(vm)
# No NA values for tied parties if enough seats are available
district_winner_matrix(vm, c(1, 2))
Run the code above in your browser using DataLab