make_iea_psut: Convert to PSUT matrices

View source: R/data_functions.R

make_iea_psutR Documentation

Convert to PSUT matrices

Description

Converts tidy IEA data to PSUT matrices in a way that is amenable to drake subtargets. Internally, IEATools::prep_psut() does the conversion to matrices.

Usage

make_iea_psut(
  SpecifiedIEAData,
  countries,
  matrix_class = c("matrix", "Matrix"),
  country = IEATools::iea_cols$country
)

Arguments

SpecifiedIEAData

A data frame that has already been specified via specify().

countries

The countries you want to convert to PSUT matrices.

matrix_class

The type of matrix to be created. One of "matrix" (the base class) or "Matrix" (for sparse matrices).

country

See IEATools::iea_cols.

Value

A matsindf-style data frame.

Examples

IEATools::sample_iea_data_path() %>%
  IEATools::load_tidy_iea_df() %>%
  make_balanced(countries = c("GHA", "ZAF")) %>%
  specify(countries = c("GHA", "ZAF")) %>%
  make_iea_psut(countries = c("GHA", "ZAF"))

EnergyEconomyDecoupling/PFUDatabase documentation built on Feb. 8, 2024, 8:45 a.m.