Package 'pacta.portfolio.audit'

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

Help Index


Adds flags columns to a portfolio data frame

Description

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.

Usage

add_portfolio_flags(portfolio, currencies)

Arguments

portfolio

A data frame containing a portfolio

currencies

A data frame containing ISO 4217 currency codes and their exchange rates.

Value

A data frame of the portfolio with the flags columns added


Calculate the financed emissions of a portfolio, by sector and asset type

Description

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.

Usage

calculate_portfolio_financed_emissions(
  data,
  entity_info,
  entity_emission_intensities,
  average_sector_emission_intensities
)

Arguments

data

A dataframe, like the total_portfolio object in web_tool_script_1.

entity_info

A dataframe, like the entity_info output of pacta.data.preparation.

entity_emission_intensities

A dataframe, like the entity_emission_intensities output of pacta.data.preparation.

average_sector_emission_intensities

A dataframe, like the average_sector_emission_intensities output of pacta.data.preparation.

Value

A summarized dataset, indicating the portfolios financed emissions, per sector and asset type.


Add columns to flag existence of data in ABCD for each holding

Description

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.

Usage

create_ald_flag(portfolio, comp_fin_data, debt_fin_data)

Arguments

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

Value

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


Create the audit file for a processed portfolio

Description

Creates an audit file from a processed portfolio, selecting the expected columns.

Usage

create_audit_file(portfolio_total, has_revenue)

Arguments

portfolio_total

A data frame

has_revenue

Logical determining if revenue data is included or not

Value

A data frame


Export audit data for Transition Monitor website

Description

Exports three audit files for the Transition Monitor website, allowing the website GUI to report to the user details about the audit process result.

Usage

export_audit_information_data(
  audit_file_ = .GlobalEnv$audit_file,
  portfolio_total_ = .GlobalEnv$portfolio_total,
  folder_path = .GlobalEnv$proc_input_path,
  project_name_ = NA
)

Arguments

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 NA which has no effect.

Value

Returns NULL invisibly as it is called only for its side effect of saving files


A short description of the function

Description

A longer description of the function

Usage

get_entity_info(dir = .GlobalEnv$analysis_inputs_path)

Arguments

dir

A string containing the path to the directory where the entity info files should be found, typically the value of the analysis_inputs_path parameter

Value

A description of the return value


A short description of the function

Description

A longer description of the function

Usage

get_input_files(
  portfolio_name_ref_all,
  project_location = .GlobalEnv$project_location
)

Arguments

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 project_location parameter

Value

A description of the return value


A short description of the function

Description

A longer description of the function

Usage

left_join_entity_info(data, entity_info, by = "factset_entity_id")

Arguments

data

A description of the argument

entity_info

A description of the argument

by

A description of the argument

Value

A description of the return value


A short description of the function

Description

A longer description of the function

Usage

portfolio_summary(portfolio_total, ...)

Arguments

portfolio_total

A description of the argument

...

A catch-all for deprecated variables (e.g. grouping_variables)

Value

A description of the return value


A short description of the function

Description

A longer description of the function

Usage

process_raw_portfolio(
  portfolio_raw,
  fin_data,
  fund_data,
  entity_info,
  currencies,
  total_fund_list = NULL,
  isin_to_fund_table = isin_to_fund_table
)

Arguments

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

Value

A description of the return value