Skip to content

Commit

Permalink
257 minimal demo data lbk and abcd (#374)
Browse files Browse the repository at this point in the history
* update data_dictionary

* update loanbook_demo

* update abcd_demo

---------

Co-authored-by: Jackson Hoffart <[email protected]>
  • Loading branch information
jacobvjk and jdhoffa authored Apr 24, 2024
1 parent b7365fa commit 46cf42e
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 91 deletions.
5 changes: 0 additions & 5 deletions data-raw/abcd_demo.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,13 @@ ordered_names <- c(
"year",
"production",
"emission_factor",
"country_of_domicile",
"plant_location",
"is_ultimate_owner",
"ald_timestamp",
emission_factor_unit = "ald_emission_factor_unit"
)

abcd_demo <- select(abcd_demo, all_of(ordered_names))

abcd_demo <- rename(abcd_demo, abcd_timestamp = ald_timestamp)


# hot fixes for late 2023 release ----------------------------------------------

# remove Shipping data
Expand Down
2 changes: 0 additions & 2 deletions data-raw/data_dictionary/abcd_demo.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ abcd_demo,production_unit,character,The units that production is measured in
abcd_demo,year,integer,Year at which the production value is predicted
abcd_demo,production,double,Company level production of the technology
abcd_demo,emission_factor,double,Company level emission factor of the technology
abcd_demo,country_of_domicile,character,Country where company is registered
abcd_demo,plant_location,character,Country where asset is located
abcd_demo,is_ultimate_owner,logical,Flag if company is the ultimate parent in our database
abcd_demo,abcd_timestamp,character,Date at which asset data was sourced from the data provider
abcd_demo,emission_factor_unit,character,The units that the emission factor is measured in
34 changes: 14 additions & 20 deletions data-raw/data_dictionary/loanbook_demo.csv
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
dataset,column,typeof,definition
loanbook_demo,id_loan,character,Unique loan identifier
loanbook_demo,id_direct_loantaker,character,Borrower identifier unique to each borrower/sector combination in loanbook
loanbook_demo,name_direct_loantaker,character,Name of the company directly taking the loan
loanbook_demo,id_intermediate_parent_n,character,Optional input: id of the n-th intermediate parent company within the company structure that can be used for more granular mapping than the ultimate parent. Smaller values of n are closer to the direct_loantaker
loanbook_demo,name_intermediate_parent_n,character,Optional input: name of intermediate parent company within the company structure that can be used for more granular mapping than the ultimate parent. Smaller values of n are closer to the direct_loantaker
loanbook_demo,id_ultimate_parent,character,Ultimate parent identifier unique to each ultimate parent/sector combination
loanbook_demo,name_ultimate_parent,character,Name of the ultimate parent company to which the borrower belongs. Can be the same as borrower
loanbook_demo,loan_size_outstanding,double,Amount drawn by borrower from total credit limit
loanbook_demo,loan_size_outstanding_currency,character,Currency corresponding to outstandings
loanbook_demo,loan_size_credit_limit,double,Total credit limit or exposure at default
loanbook_demo,loan_size_credit_limit_currency,character,Currency corresponding to credit limit
loanbook_demo,sector_classification_system,character,Name of the sector classification standard being used
loanbook_demo,sector_classification_input_type,character,Flag identifying if the sector classification code or character description is used
loanbook_demo,sector_classification_direct_loantaker,double,Sector classification code of the direct loantaker
loanbook_demo,fi_type,character,Financial instrument name or asset class
loanbook_demo,flag_project_finance_loan,character,Project finance flag denoting whether a loan is given out to a particular asset or not
loanbook_demo,name_project,logical,Required input for loans with the flag_project_finance_loan = TRUE: Name of the project being financed
loanbook_demo,lei_direct_loantaker,logical,Optional input: providing the lei (legal entity identifier) of the direct loan taker to improve the matching coverage
loanbook_demo,isin_direct_loantaker,logical,Optional input: providing the isin identifier of the direct loan taker to improve the matching coverage
dataset,column,typeof,definition
loanbook_demo,id_loan,character,Unique loan identifier
loanbook_demo,id_direct_loantaker,character,Borrower identifier unique to each borrower/sector combination in loanbook
loanbook_demo,name_direct_loantaker,character,Name of the company directly taking the loan
loanbook_demo,id_ultimate_parent,character,Ultimate parent identifier unique to each ultimate parent/sector combination
loanbook_demo,name_ultimate_parent,character,Name of the ultimate parent company to which the borrower belongs. Can be the same as borrower
loanbook_demo,loan_size_outstanding,double,Amount drawn by borrower from total credit limit
loanbook_demo,loan_size_outstanding_currency,character,Currency corresponding to outstandings
loanbook_demo,loan_size_credit_limit,double,Total credit limit or exposure at default
loanbook_demo,loan_size_credit_limit_currency,character,Currency corresponding to credit limit
loanbook_demo,sector_classification_system,character,Name of the sector classification standard being used
loanbook_demo,sector_classification_direct_loantaker,double,Sector classification code of the direct loantaker
loanbook_demo,lei_direct_loantaker,logical,Optional input: providing the lei (legal entity identifier) of the direct loan taker to improve the matching coverage
loanbook_demo,isin_direct_loantaker,logical,Optional input: providing the isin identifier of the direct loan taker to improve the matching coverage
10 changes: 2 additions & 8 deletions data-raw/loanbook_demo.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,18 @@ source(file.path("data-raw", "utils.R"))
path <- file.path("data-raw", "loanbook_demo.csv")
loanbook_demo <- readr::read_csv(
path,
col_types = readr::cols(
col_types = readr::cols_only(
id_loan = "c",
id_direct_loantaker = "c",
name_direct_loantaker = "c",
id_intermediate_parent_1 = "c",
name_intermediate_parent_1 = "c",
id_ultimate_parent = "c",
name_ultimate_parent = "c",
loan_size_outstanding = "d",
loan_size_outstanding_currency = "c",
loan_size_credit_limit = "d",
loan_size_credit_limit_currency = "c",
sector_classification_system = "c",
sector_classification_input_type = "c",
sector_classification_direct_loantaker = "d",
fi_type = "c",
flag_project_finance_loan = "c",
name_project = "c",
sector_classification_direct_loantaker = "c",
lei_direct_loantaker = "c",
isin_direct_loantaker = "c"
)
Expand Down
Binary file modified data/abcd_demo.rda
Binary file not shown.
Binary file modified data/data_dictionary.rda
Binary file not shown.
Binary file modified data/loanbook_demo.rda
Binary file not shown.
4 changes: 2 additions & 2 deletions man/abcd_demo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/data_dictionary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/loanbook_demo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 5 additions & 15 deletions tests/testthat/_snaps/abcd_demo.md

Large diffs are not rendered by default.

Loading

0 comments on commit 46cf42e

Please sign in to comment.