Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
add meta loan book to run_aggregate_loanbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobvjk committed Feb 29, 2024
1 parent 28120db commit d655e1c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions run_aggregate_loanbooks.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ if (apply_sector_split & sector_split_type_select %in% c("equal_weights", "worst
)
}

# meta loan book----
# aggregate all individual loan books into one meta loan book and add that to
# the full list of loan books
matched_prioritized_meta <- matched_prioritized %>%
dplyr::mutate(
id_loan = paste0(.data$id_loan, "_", .data$group_id),
group_id = "meta_loanbook"
)

matched_prioritized <- matched_prioritized %>%
dplyr::bind_rows(matched_prioritized_meta)

# write final version of matched_prioritized to file for use in plot_aggregate_loanbooks.R
matched_prioritized %>%
readr::write_csv(file.path(input_path_matched, "matched_prioritized_final_for_plots.csv"))
Expand Down

0 comments on commit d655e1c

Please sign in to comment.