Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments related to #134 #136

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/surname_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ predict_race_multi_barreled <- function(voter_file,
new_voter_file <- data.frame(surname = surnames)
# Calculate probabilities using surnames only
probabilities <- suppressWarnings(
wru::merge_surnames(
wru:::merge_surnames(
voter.file = new_voter_file,
surname.year = 2010,
clean.surname = FALSE,
Expand Down Expand Up @@ -281,8 +281,8 @@ predict_race_multi_barreled <- function(voter_file,
surname.year = surname_year,
census.geo = census_geo,
census.data = census_data,
age = use_age,
sex = use_sex,
age = F,
sex = F,
)
)
))
Expand Down
4 changes: 2 additions & 2 deletions R/wru_predict_race_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ wru_predict_race_wrapper <- function(voter_file,
message("Matching surnames.")
}
merged_surnames <- suppressWarnings(
wru::merge_surnames(
wru:::merge_surnames(
voter.file = wru_voter_file,
surname.year = surname_year,
clean.surname = TRUE,
Expand Down Expand Up @@ -167,7 +167,7 @@ wru_predict_race_wrapper <- function(voter_file,
# Use probabilities from surnames only for those that don't match
invisible(capture.output(
no_match_surnames <- suppressWarnings(
wru::merge_surnames(
wru:::merge_surnames(
voter.file = wru_voter_file[no_match_final, ],
surname.year = surname_year,
clean.surname = TRUE,
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test_wru_predict_race_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ test_that("WRU wrapper correctly calculates probabilities.", {

# Load Rockland county Census information
data(rockland_census)

rockland_census$NY$year = "2010"

# Run predict race wrapper function
bisg <- wru_predict_race_wrapper(
Expand Down