Package 'pacta.data.validation'

Title: pacta.data.validation
Description: For more information visit <https://rmi.org/>.
Authors: CJ Yetman [aut, cre, ctr] , Jackson Hoffart [aut, ctr] , Jacob Kastl [aut, ctr], Alex Axthelm [aut, ctr] , RMI [cph, fnd]
Maintainer: CJ Yetman <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-10-30 12:23:47 UTC
Source: https://github.com/rmi-pacta/pacta.data.validation

Help Index


Create an example abcd_flags_bonds object

Description

This function creates an example abcd_flags_bonds object.

Usage

fake_abcd_flags_bonds(
  credit_parent_id = "000BGD-E",
  has_asset_level_data = TRUE,
  has_ald_in_fin_sector = TRUE,
  sectors_with_assets = "Power + Oil&Gas"
)

Arguments

credit_parent_id

value/s to be used for the credit_parent_id column

has_asset_level_data

value/s to be used for the has_asset_level_data column

has_ald_in_fin_sector

value/s to be used for the has_ald_in_fin_sector column

sectors_with_assets

value/s to be used for the sectors_with_assets column

Value

A data frame with the specified columns and/or their default values


Create an example abcd_flags_equity object

Description

This function creates an example abcd_flags_equity object.

Usage

fake_abcd_flags_equity(
  isin = "US3140KKGV04",
  has_asset_level_data = TRUE,
  has_ald_in_fin_sector = TRUE,
  sectors_with_assets = "Power + Oil&Gas"
)

Arguments

isin

value/s to be used for the isin column

has_asset_level_data

value/s to be used for the has_asset_level_data column

has_ald_in_fin_sector

value/s to be used for the has_ald_in_fin_sector column

sectors_with_assets

value/s to be used for the sectors_with_assets column

Value

A data frame with the specified columns and/or their default values


Create an example currencies object

Description

This function creates an example currencies object.

Usage

fake_currencies(currency = "USD", exchange_rate = 1)

Arguments

currency

value/s to be used for the currency column

exchange_rate

value/s to be used for the exchange_rate column

Value

A data frame with the specified columns and/or their default values


Create an example financial_data object

Description

This function creates an example financial_data object.

Usage

fake_financial_data(
  isin = "US3140KKGV04",
  unit_share_price = 12.3,
  current_shares_outstanding_all_classes = 333000,
  asset_type = "Equity",
  factset_entity_id = "000Y86-E"
)

Arguments

isin

value/s to be used for the isin column

unit_share_price

value/s to be used for the unit_share_price column

current_shares_outstanding_all_classes

value/s to be used for the current_shares_outstanding_all_classes column

asset_type

value/s to be used for the asset_type column

factset_entity_id

value/s to be used for the factset_entity_id column

Value

A data frame with the specified columns and/or their default values


Create an example intermediate_scenario_data object

Description

This function creates an example intermediate_scenario_data object.

Usage

fake_intermediate_scenario_data(
  source = "WEO2022",
  scenario = "NZE_2050",
  scenario_geography = "Global",
  sector = "Power",
  technology = "RenewablesCap",
  indicator = "Capacity: installed",
  units = "GW",
  year = 2025,
  value = 500
)

Arguments

source

value/s to be used for the source column

scenario

value/s to be used for the scenario column

scenario_geography

value/s to be used for the scenario_geography column

sector

value/s to be used for the sector column

technology

value/s to be used for the technology column

indicator

value/s to be used for the indicator column

units

value/s to be used for the units column

year

value/s to be used for the year column

value

value/s to be used for the value column

Value

A data frame with the specified columns and/or their default values


Create an example masterdata_debt_datastore object

Description

This function creates an example masterdata_debt_datastore object.

Usage

fake_masterdata_debt_datastore(
  id = "8",
  id_name = "credit_parent_ar_company_id",
  ald_sector = "Oil&Gas",
  ald_location = "DE",
  technology = "Gas",
  year = 2022,
  country_of_domicile = "DE",
  ald_production_unit = "GJ",
  ald_production = 52281230,
  ald_emissions_factor_unit = "tonnes of CO2 per GJ",
  ald_emissions_factor = 0.06202439
)

Arguments

id

value/s to be used for the id column

id_name

value/s to be used for the id_name column

ald_sector

value/s to be used for the ald_sector column

ald_location

value/s to be used for the ald_location column

technology

value/s to be used for the technology column

year

value/s to be used for the year column

country_of_domicile

value/s to be used for the country_of_domicile column

ald_production_unit

value/s to be used for the ald_production_unit column

ald_production

value/s to be used for the ald_production column

ald_emissions_factor_unit

value/s to be used for the ald_emissions_factor_unit column

ald_emissions_factor

value/s to be used for the ald_emissions_factor column

Value

A data frame with the specified columns and/or their default values


Create an example masterdata_ownership_datastore object

Description

This function creates an example masterdata_ownership_datastore object.

Usage

fake_masterdata_ownership_datastore(
  id = "8",
  id_name = "ar_company_id",
  ald_sector = "Oil&Gas",
  ald_location = "DE",
  technology = "Gas",
  year = 2022,
  ald_production = 52281230,
  ald_production_unit = "GJ",
  ald_emissions_factor = 0.06202439,
  ald_emissions_factor_unit = "tonnes of CO2 per GJ",
  country_of_domicile = "DE"
)

Arguments

id

value/s to be used for the id column

id_name

value/s to be used for the id_name column

ald_sector

value/s to be used for the ald_sector column

ald_location

value/s to be used for the ald_location column

technology

value/s to be used for the technology column

year

value/s to be used for the year column

ald_production

value/s to be used for the ald_production column

ald_production_unit

value/s to be used for the ald_production_unit column

ald_emissions_factor

value/s to be used for the ald_emissions_factor column

ald_emissions_factor_unit

value/s to be used for the ald_emissions_factor_unit column

country_of_domicile

value/s to be used for the country_of_domicile column

Value

A data frame with the specified columns and/or their default values


Validate a vector of ISINs

Description

This function validates that a vector of ISINs are valid codes that conform to the ISO 6166 specification with TRUE or FALSE. It checks the basic structure (2 alpha characters, 9 alpha-numeric characters, 1 check digit) and also validates the check digit using the Luhn algorithm.

Usage

is_valid_isin(isins)

Arguments

isins

A character vector

Value

A logical vector the same length as isins.


Validate a abcd_flags_bonds object

Description

This function validates that an object is a valid abcd_flags_bonds dataset.

Usage

validate_abcd_flags_bonds(data)

Arguments

data

An object (typically a data frame)

Value

TRUE if the object is valid, otherwise an error with a message explaining the failed assertions


Validate a abcd_flags_equity object

Description

This function validates that an object is a valid abcd_flags_equity dataset.

Usage

validate_abcd_flags_equity(data)

Arguments

data

An object (typically a data frame)

Value

TRUE if the object is valid, otherwise an error with a message explaining the failed assertions


Validate a currencies object

Description

This function validates that an object is a valid currencies dataset.

Usage

validate_currencies(data)

Arguments

data

An object (typically a data frame)

Value

TRUE if the object is valid, otherwise an error with a message explaining the failed assertions


Validate a financial_data object

Description

This function validates that an object is a valid financial_data dataset.

Usage

validate_financial_data(data)

Arguments

data

An object (typically a data frame)

Value

TRUE if the object is valid, otherwise an error with a message explaining the failed assertions


Validate an intermediate scenario object

Description

This function validates that an object is a valid intermediate scenario dataset (e.g. weo_2022, geco_2022, or more generally, publication_YYYY).

Usage

validate_intermediate_scenario_output(data)

Arguments

data

An object (typically a data frame)

Value

TRUE if the object is valid, otherwise an error with a message explaining the failed assertions


Validate a masterdata_debt_datastore object

Description

This function validates that an object is a valid masterdata_debt_datastore dataset.

Usage

validate_masterdata_debt_datastore(data)

Arguments

data

An object (typically a data frame)

Value

TRUE if the object is valid, otherwise an error with a message explaining the failed assertions


Validate a masterdata_ownership_datastore object

Description

This function validates that an object is a valid masterdata_ownership_datastore dataset.

Usage

validate_masterdata_ownership_datastore(data)

Arguments

data

An object (typically a data frame)

Value

TRUE if the object is valid, otherwise an error with a message explaining the failed assertions