From 6a9fea45f95eb43142fb5702efa5959386168da7 Mon Sep 17 00:00:00 2001 From: CJ Yetman - RMI Date: Sun, 18 Aug 2024 22:55:04 +0200 Subject: [PATCH] replace `janitor::clean_names()` with a simple base alternative --- DESCRIPTION | 1 - R/prepare_sector_split.R | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2e579742..17cec632 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,7 +20,6 @@ Imports: dplyr, ggplot2, glue, - janitor, htmlwidgets, pacta.multi.loanbook.analysis, pacta.multi.loanbook.plot, diff --git a/R/prepare_sector_split.R b/R/prepare_sector_split.R index 0055c2e8..fc15a926 100644 --- a/R/prepare_sector_split.R +++ b/R/prepare_sector_split.R @@ -113,7 +113,7 @@ prepare_sector_split <- function() { # calculate sector split---- ## wrangle input data---- advanced_company_indicators <- advanced_company_indicators_raw %>% - janitor::clean_names() %>% + dplyr::rename_with(.fn = ~ gsub(" ", "_", tolower(.x))) %>% # to compare primary energy units, we need power generation, not power capacity dplyr::filter( (.data$asset_sector == "Power" & .data$activity_unit == "MWh") | .data$asset_sector != "Power"