Skip to content

Commit

Permalink
Remove unecessary call to tidyselect::all_of
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoch94 committed Jun 5, 2024
1 parent b120bf3 commit 37d5f88
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions R/adapt_source.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ adapt_source <- function(gdp, source, with_regions, replace_NAs, require_year_co
{if ("gdpuc_region" %in% colnames(.)) dplyr::filter(., is.na(.data$gdpuc_region)) else .} %>%
dplyr::select(tidyselect::all_of(hcol)) %>%
dplyr::distinct() %>%
dplyr::anti_join(source, by = tidyselect::all_of(hcol))) %>%
dplyr::anti_join(source, by = hcol)) %>%
tidyr::complete(.data$iso3c, .data$year) %>%
dplyr::filter(!is.na(.data$year))

Expand Down Expand Up @@ -92,11 +92,10 @@ adapt_source <- function(gdp, source, with_regions, replace_NAs, require_year_co
source_adapted <- source_adapted %>%
# Mutate the 3 important columns
dplyr::rowwise() %>%
dplyr::mutate(dplyr::across(.cols = c(
"GDP deflator",
"MER (LCU per US$)",
"PPP conversion factor, GDP (LCU per international $)"),
~ if (is.na(.x)) 1 else .x)) %>%
dplyr::mutate(dplyr::across(c("GDP deflator",
"MER (LCU per US$)",
"PPP conversion factor, GDP (LCU per international $)"),
~ if (is.na(.x)) 1 else .x)) %>%
dplyr::ungroup()
}

Expand Down

0 comments on commit 37d5f88

Please sign in to comment.