add_row_col_meta: Add row, column, row type, and column type metadata

View source: R/psut.R

add_row_col_metaR Documentation

Add row, column, row type, and column type metadata

Description

After calling add_psut_matnames(), call this function to add rownames, colnames, rowtypes, and coltypes columns to .tidy_iea_df.

Usage

add_row_col_meta(
  .tidy_iea_df,
  product = IEATools::iea_cols$product,
  flow = IEATools::iea_cols$flow,
  matnames = IEATools::mat_meta_cols$matnames,
  U = IEATools::psut_cols$U,
  U_EIOU = IEATools::psut_cols$U_eiou,
  R = IEATools::psut_cols$R,
  V = IEATools::psut_cols$V,
  Y = IEATools::psut_cols$Y,
  B = IEATools::psut_cols$B,
  industry_type = IEATools::row_col_types$industry,
  product_type = IEATools::row_col_types$product,
  sector_type = IEATools::row_col_types$sector,
  resource_type = IEATools::row_col_types$resource,
  rownames = IEATools::mat_meta_cols$rownames,
  colnames = IEATools::mat_meta_cols$colnames,
  rowtypes = IEATools::mat_meta_cols$rowtypes,
  coltypes = IEATools::mat_meta_cols$coltypes
)

Arguments

.tidy_iea_df

a data frame containing column matnames

flow, product

See IEATools::iea_cols.

matnames

the name of the column in .tidy_iea_df that contains names of matrices (a string). Default is "matnames".

R, U, U_EIOU, V, Y, B

See IEATools::psut_cols.

industry_type, product_type, sector_type, resource_type

See IEATools::row_col_types.

rownames, colnames, rowtypes, coltypes

See IEATools::mat_meta_cols.

Details

If .tidy_iea_df already contains all of rownames, colnames, rowtypes, and coltypes, .tidy_iea_df is returned without modification. If .tidy_iea_df contains some but not all of rownames, colnames, rowtypes, or coltypes, an error is returned.

Value

.tidy_iea_df with additional columns named rowname, colname, rowtype, and coltype.

Examples

library(dplyr)
load_tidy_iea_df() %>% 
  add_psut_matnames() %>%
  add_row_col_meta()

MatthewHeun/IEATools documentation built on Dec. 14, 2024, 12:08 a.m.