Learn R Programming

carbonr (version 0.2.1)

carbon_price_credit: Calculate carbon price credit

Description

This function calculates the carbon price credit for a given jurisdiction, year, period, and CO2e value. It uses CPI (Carbon Price Index) data to determine the carbon price for the specified jurisdiction and time period. The carbon price credit is calculated by multiplying the CO2e value by the corresponding carbon price.

Usage

carbon_price_credit(
  jurisdiction = NULL,
  year = NULL,
  period = 0,
  manual_price = NULL,
  co2e_val
)

Value

The calculated carbon price credit in USD ($).

Arguments

jurisdiction

A character string specifying the jurisdiction for which the carbon price credit should be calculated.

year

An optional numeric value specifying the year for which the carbon price credit should be calculated. If NULL, the most recent year available in the CPI data will be used.

period

An optional numeric value specifying the period within the specified year for which the carbon price credit should be calculated. If 1, the function will use the first period if it is available; if 2, the function will use the second period if it is available. If 0, the function will calculate the mean between the first and second period.

manual_price

An option to manually input a carbon price index to override the value in the World Bank Data. This should be a value of the carbon credit price per tCO2e.

co2e_val

A numeric value specifying the CO2e (carbon dioxide equivalent) value for which the carbon price credit should be calculated.

Examples

Run this code
# Calculate carbon price credit for the United Kingdom in the year 2000,
# period 2, and CO2e value of 100
carbon_price_credit("United Kingdom", 2022, 2, co2e_val = 100)

# Or manually enter a value
carbon_price_credit(manual_price = 66.9, co2e_val = 100)

Run the code above in your browser using DataLab