library(eiExpand)
data(south_carolina)
# Get sample election data
D5_election <- south_carolina %>%
dplyr::filter(District == 5)
# Run performance Analysis on 2018 Governor contest
perf_results <- performance(
data = D5_election,
cands = c("R_mcmaster", "D_smith"),
candidate = c("McMaster (R)", "Smith (D)"), # formatted candidate names
preferred_candidate = c("White", "Black"), # race preference of candidates respectively
total = "total_gov",
contest = "Governor",
year = 2018,
election_type = "General",
jurisdiction = "District 5"
)
Run the code above in your browser using DataLab