| Title: | Functions for Calculating Audit Statistics for PACTA on Capital Transition Monitor |
|---|---|
| Description: | These utils include functions that facilitate calculation of useful audit statistics for PACTA on Capital Transition Monitor. |
| Authors: | CJ Yetman [aut, cre, ctr] (ORCID: <https://orcid.org/0000-0001-5099-9500>), Jackson Hoffart [aut, ctr] (ORCID: <https://orcid.org/0000-0002-8600-5042>), RMI [cph, fnd] |
| Maintainer: | CJ Yetman <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.1.9000 |
| Built: | 2026-05-24 07:19:32 UTC |
| Source: | https://github.com/rmi-pacta/pacta.portfolio.audit |
Adds flags columns to a portfolio data frame signifying if each holding has a currency specified, has a valid value, has a valid ISIN, and has matching financial data.
add_portfolio_flags(portfolio, currencies)add_portfolio_flags(portfolio, currencies)
portfolio |
A data frame containing a portfolio |
currencies |
A data frame containing ISO 4217 currency codes and their exchange rates. |
A data frame of the portfolio with the flags columns added
This functions takes as input a total_portfolio object, and calculates the financed emissions associated to that portfolio, by sector and asset type. If no real emissions data exist for an entity, a sectoral average is used.
calculate_portfolio_financed_emissions( data, entity_info, entity_emission_intensities, average_sector_emission_intensities )calculate_portfolio_financed_emissions( data, entity_info, entity_emission_intensities, average_sector_emission_intensities )
data |
A dataframe, like the total_portfolio object in web_tool_script_1. |
entity_info |
A dataframe, like the |
entity_emission_intensities |
A dataframe, like the
|
average_sector_emission_intensities |
A dataframe, like the
|
A summarized dataset, indicating the portfolios financed emissions, per sector and asset type.
Adds columns to a portfolio data frame flagging the existence of data related
to each holding in the ABCD data. It will add the has_asset_level_data,
sectors_with_assets, and has_ald_in_fin_sector columns.
create_ald_flag(portfolio, comp_fin_data, debt_fin_data)create_ald_flag(portfolio, comp_fin_data, debt_fin_data)
portfolio |
A data frame containing portfolio data |
comp_fin_data |
A data frame containing company financial data |
debt_fin_data |
A data frame containing debt financial data |
A data frame similar to the input portfolion data frame with three
added columns has_asset_level_data, sectors_with_assets, and
has_ald_in_fin_sector
Creates an audit file from a processed portfolio, selecting the expected columns.
create_audit_file(portfolio_total, has_revenue)create_audit_file(portfolio_total, has_revenue)
portfolio_total |
A data frame |
has_revenue |
Logical determining if revenue data is included or not |
A data frame
Exports three audit files for the Transition Monitor website, allowing the website GUI to report to the user details about the audit process result.
export_audit_information_data( audit_file_ = .GlobalEnv$audit_file, portfolio_total_ = .GlobalEnv$portfolio_total, folder_path = .GlobalEnv$proc_input_path, project_name_ = NA )export_audit_information_data( audit_file_ = .GlobalEnv$audit_file, portfolio_total_ = .GlobalEnv$portfolio_total, folder_path = .GlobalEnv$proc_input_path, project_name_ = NA )
audit_file_ |
A data frame containing the audit data |
portfolio_total_ |
A data frame containing the processed portfolio data |
folder_path |
A length one character vector specifying the path where the exported audit files should be saved |
project_name_ |
An optional length one character vector specifying a
project name to prepend to the filenames. Default is |
Returns NULL invisibly as it is called only for its side effect of
saving files
A longer description of the function
get_entity_info(dir = .GlobalEnv$analysis_inputs_path)get_entity_info(dir = .GlobalEnv$analysis_inputs_path)
dir |
A string containing the path to the directory where the entity
info files should be found, typically the value of the
|
A description of the return value
A longer description of the function
get_input_files( portfolio_name_ref_all, project_location = .GlobalEnv$project_location )get_input_files( portfolio_name_ref_all, project_location = .GlobalEnv$project_location )
portfolio_name_ref_all |
A description of the argument |
project_location |
A character string defining the path to the user's
data directory, usually "working_dir" and the value held in the
|
A description of the return value
A longer description of the function
left_join_entity_info(data, entity_info, by = "factset_entity_id")left_join_entity_info(data, entity_info, by = "factset_entity_id")
data |
A description of the argument |
entity_info |
A description of the argument |
by |
A description of the argument |
A description of the return value
A longer description of the function
portfolio_summary(portfolio_total, ...)portfolio_summary(portfolio_total, ...)
portfolio_total |
A description of the argument |
... |
A catch-all for deprecated variables (e.g. |
A description of the return value
A longer description of the function
process_raw_portfolio( portfolio_raw, fin_data, fund_data, entity_info, currencies, total_fund_list = NULL, isin_to_fund_table = isin_to_fund_table )process_raw_portfolio( portfolio_raw, fin_data, fund_data, entity_info, currencies, total_fund_list = NULL, isin_to_fund_table = isin_to_fund_table )
portfolio_raw |
A description of the argument |
fin_data |
A description of the argument |
fund_data |
A description of the argument |
entity_info |
A description of the argument |
currencies |
A description of the argument |
total_fund_list |
A description of the argument |
isin_to_fund_table |
A description of the argument |
A description of the return value