Remove / Impute NAs in an EI dataset
resolve_missing_vals(
data,
cand_cols,
race_cols,
totals_col,
na_action = "DROP",
verbose = TRUE
)
A dataframe of inputs to ecological inference without any missing values.
A data.frame() object containing precinct-level turnout data by race and candidate
A character vector listing the column names for turnout for each candidate
A character vector listing the column names for turnout by race
The name of the column containing total votes cast in each precinct
A string indicating how to handle missing values in EI columns. Possible values are "DROP" and "MEAN". "DROP" drops all rows where variables are missing. "MEAN" imputes missing values as the mean of the column
A boolean indicating whether to give status updates