From 5e68d24a0c04542a5c766dcd9c4d2b5098406d13 Mon Sep 17 00:00:00 2001 From: Brandon Bertelsen Date: Tue, 13 Feb 2024 16:31:32 -0500 Subject: [PATCH] Adjustments for piggyback failures --- DESCRIPTION | 1 + R/merge_names.R | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3498fdd..9f38a99 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,6 +8,7 @@ Authors@R: c( person("Brandon", "Bertelsen", , "brandon@bertelsen.ca", role = c("aut", "cre")), person("Santiago", "Olivella", , "olivella@unc.edu", role = "aut"), person("Evan", "Rosenman", , "etrrosenman@gmail.com", role = "aut"), + person("Alex", "Rossell Hayes", "alexander@rossellhayes.com", role = "aut")), person("Kosuke", "Imai", , "imai@harvard.edu", role = "aut") ) Description: Predicts individual race/ethnicity using surname, first name, diff --git a/R/merge_names.R b/R/merge_names.R index 4fe4cbe..467f337 100644 --- a/R/merge_names.R +++ b/R/merge_names.R @@ -338,7 +338,8 @@ merge_names <- function(voter.file, namesToUse, census.surname, table.surnames = wru_data_preflight <- function() { dest <- ifelse(getOption("wru_data_wd", default = FALSE), getwd(), tempdir()) tryCatch( - piggyback::pb_download(repo = "kosukeimai/wru", dest = dest), - error = function(e) message("There was an error retrieving data", e$message) + # Oddity of conditions for .token. Ignores token if is "" + piggyback::pb_download(repo = "kosukeimai/wru", dest = dest, .token = ""), + error = function(e) message("There was an error retrieving data: ", e$message) ) }