Skip to content

Commit 96135cc

Browse files
committed
Add other vote ranking methods
1 parent 345379c commit 96135cc

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

data-raw/get_data.R

+38
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,44 @@ y$other_info$count_max %>%
11961196
arrange(desc(score))
11971197

11981198

1199+
## Other methods ----
1200+
1201+
# Simple
1202+
y_simple <- cdc_simple(vote)
1203+
y_simple$winner # NULL
1204+
1205+
# Copeland
1206+
# Pairwise comparisons
1207+
y_copeland <- cdc_copeland(vote)
1208+
y_copeland$other_info$copeland_score %>%
1209+
data.frame() %>%
1210+
rownames_to_column("film") %>%
1211+
as_tibble() %>%
1212+
rename("score" = ".") %>%
1213+
arrange(desc(score))
1214+
1215+
# Dodgson
1216+
# Checks number of votes each film will need to get from others
1217+
y_dodgson <- cdc_dodgson(vote)
1218+
y_dodgson$other_info$tideman %>%
1219+
data.frame() %>%
1220+
rownames_to_column("film") %>%
1221+
as_tibble() %>%
1222+
rename("score" = ".") %>%
1223+
arrange(score)
1224+
y_dodgson$other_info$dodgson_quick %>%
1225+
data.frame() %>%
1226+
rownames_to_column("film") %>%
1227+
as_tibble() %>%
1228+
rename("score" = ".") %>%
1229+
arrange(score)
1230+
1231+
# Instant-Runoff voting method
1232+
# Incremental rounds of removing the least popular film and continuing
1233+
y_irv <- irv_method(vote)
1234+
y_irv$other_info
1235+
1236+
11991237
# Save out data for use ---------------------------------------------------
12001238

12011239
# Join all data into single, long data frame

0 commit comments

Comments
 (0)