Skip to content

Commit

Permalink
move to tidyr::spread from spread_
Browse files Browse the repository at this point in the history
  • Loading branch information
medewitt committed Apr 28, 2024
1 parent 2f59f25 commit b50f952
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/get_qwi.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ get_qwi <- function(years,
call <- httr::GET(urls$url[[1]])


if(!substr(call$status_code,1,1) == "2"|
show_condition(check_census_api_call(call))!="error"){
if(!substr(call$status_code, 1, 1) == "2" ||
show_condition(check_census_api_call(call))!="error") {
# IF 200 was not returned then there was an error.

if(grepl(pattern = "valid key must", check_census_api_call(call))){
if(grepl(pattern = "valid key must", check_census_api_call(call))) {
stop(check_census_api_call(call))
}
}
Expand All @@ -265,7 +265,7 @@ get_qwi <- function(years,

#results <- purrr::map(urls$url, httr::GET)
results <- vector("list", length = nrow(urls))
for(i in 1:nrow(urls)){
for(i in 1:nrow(urls)) {
results[[i]] <- httr::GET(urls$url[[i]])
#print(paste0(i, "out of", nrow(urls)))
}
Expand All @@ -281,7 +281,7 @@ get_qwi <- function(years,

a<- purrr::transpose(output)[["result"]]

non_error_returns <- tidyr::spread_(
non_error_returns <- tidyr::spread(
dplyr::bind_rows(
purrr::compact(a)),
"parameter", "value", fill = NA)
Expand Down

0 comments on commit b50f952

Please sign in to comment.