Skip to content

Commit

Permalink
Fix naming in multi_geo_*
Browse files Browse the repository at this point in the history
  • Loading branch information
camille-s committed Dec 13, 2020
1 parent 0548729 commit 846bc12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions R/multi_geo_acs.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ multi_geo_acs <- function(table, year = 2018, towns = "all", regions = NULL, cou
lvls <- rev(fetch)
list(lvls, names(lvls), 1:length(lvls)) %>%
purrr::pmap_dfr(function(df, lvl, i) {
df %>% dplyr::mutate(level = paste(i, lvl, sep = "_"))
df %>%
dplyr::mutate(level = paste(i, lvl, sep = "_")) %>%
janitor::clean_names()
}) %>%
dplyr::mutate(year = year) %>%
dplyr::mutate(level = forcats::as_factor(level)) %>%
janitor::clean_names()
dplyr::mutate(level = forcats::as_factor(level))
}
7 changes: 4 additions & 3 deletions R/multi_geo_decennial.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ multi_geo_decennial <- function(table, year = 2010, towns = "all", regions = NUL
lvls <- rev(fetch)
list(lvls, names(lvls), 1:length(lvls)) %>%
purrr::pmap_dfr(function(df, lvl, i) {
df %>% dplyr::mutate(level = paste(i, lvl, sep = "_"))
df %>%
dplyr::mutate(level = paste(i, lvl, sep = "_")) %>%
janitor::clean_names()
}) %>%
dplyr::mutate(year = year) %>%
dplyr::mutate(level = forcats::as_factor(level)) %>%
janitor::clean_names()
dplyr::mutate(level = forcats::as_factor(level))
}

0 comments on commit 846bc12

Please sign in to comment.