Skip to content

Commit

Permalink
refactor(app): #60 namespace purrr and readr
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAxthelm committed Feb 26, 2024
1 parent 93a981b commit 7408d33
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions prepare_pacta_indices.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# necessary packages -----------------------------------------------------------
# please add all dependencies to imports.R
suppressPackageStartupMessages({
library("dplyr")
})

# config
readRenviron(".env")
Expand Down Expand Up @@ -130,7 +133,7 @@ for (portfolio_name in portfolio_names) {
)
)

write_csv(
readr::write_csv(
portfolio,
file.path(working_dir, "20_Raw_Inputs", paste0(portfolio_name, ".csv"))
)
Expand Down Expand Up @@ -184,7 +187,7 @@ output_files <- list.files(

combined <-
output_files %>%
map_dfr(readRDS)
purrr::map_dfr(readRDS)

unlink(output_files)

Expand Down Expand Up @@ -217,7 +220,7 @@ output_files_emissions <- list.files(
)

combined_emissions <- output_files_emissions %>%
map_dfr(readRDS)
purrr::map_dfr(readRDS)

unlink(output_files_emissions)

Expand Down Expand Up @@ -250,7 +253,7 @@ output_files_audit <- list.files(
)

combined_audit <- output_files_audit %>%
map_dfr(readRDS)
purrr::map_dfr(readRDS)

unlink(output_files_audit)

Expand Down

0 comments on commit 7408d33

Please sign in to comment.