extract_S_units_from_tidy | R Documentation |
Unit summation matrices have products in rows and units in columns, with
1
s where a product is expressed in the unit and 0
s otherwise.
extract_S_units_from_tidy(
.tidy_iea_df,
matrix_class = c("matrix", "Matrix"),
ledger_side = IEATools::iea_cols$ledger_side,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
flow = IEATools::iea_cols$flow,
product = IEATools::iea_cols$product,
e_dot = IEATools::iea_cols$e_dot,
unit = IEATools::iea_cols$unit,
matnames = IEATools::mat_meta_cols$matnames,
product_type = IEATools::row_col_types$product,
unit_type = IEATools::row_col_types$unit,
s_units = IEATools::psut_cols$s_units,
.val = ".val",
.rowtype = ".rowtype",
.coltype = ".coltype"
)
.tidy_iea_df |
the tidy data frame from which a unit summation |
matrix_class |
The type of matrix to be created, one of "matrix" or "Matrix". Default is "matrix". |
ledger_side , flow_aggregation_point , flow , product , e_dot , unit , matnames |
See |
product_type , unit_type |
See |
s_units |
See |
.val |
the name of a temporary value column to be created in |
.rowtype |
the name of a temporary rowtype column created in |
.coltype |
the name of a temporary coltype column created in |
.tidy_iea_df
should be grouped as needed, typically on
Country
, Year
, EnergyType
, Last.stage
, etc., but
not on Unit
, Flow
or Product
.
.tidy_iea_df
is typically obtained from tidy_iea_df()
.
a data frame containing grouping variables and a new column of unit summation matrices called s_unit
.
library(dplyr)
load_tidy_iea_df() %>%
extract_S_units_from_tidy()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.