Skip to content

Commit

Permalink
fix #565
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerke committed Jan 23, 2025
1 parent 1952db3 commit 5da9ec6
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions R/acs.R
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,17 @@ get_acs <- function(geography, variables = NULL, table = NULL, cache_table = FAL
show_call = show_call
)
)
) %>%
reduce(left_join, by = c("GEOID", "NAME"))
)

if (year == 2010) {
result_no_geo <- result_no_geo %>%
reduce(left_join, by = "GEOID")
} else {
result_no_geo <- result_no_geo %>%
reduce(left_join, by = c("GEOID", "NAME"))
}



# NAME.x and NAME.y columns exist when keep_geo_vars = TRUE
if(keep_geo_vars) {
Expand Down Expand Up @@ -485,8 +494,16 @@ get_acs <- function(geography, variables = NULL, table = NULL, cache_table = FAL
show_call = show_call
)
)
) %>%
reduce(left_join, by = c("GEOID", "NAME"))
)

if (year == 2010) {
result <- result %>%
reduce(left_join, by = "GEOID")
} else {
result <- result %>%
reduce(left_join, by = c("GEOID", "NAME"))
}

} else {
result <- map_df(vars_by_type, ~
suppressMessages(
Expand Down

0 comments on commit 5da9ec6

Please sign in to comment.