knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(IEATools)
colorize <- function(color, x) { if (knitr::is_latex_output()) { sprintf("\\textcolor{%s}{%s}", color, x) } else if (knitr::is_html_output()) { sprintf("<span style='color: %s;'>%s</span>", color, x) } else x }
The prep_psut()
function creates matsindf
-style data frames of matrices.
Each matrix has character strings for row and column names.
The row and column names follow strict conventions.
This vignette documents those conventions.
The rules for the row and column names are given below:
The R matrix has industries (resources) in rows. All row names in the R matrix have the same form:
primary_product
]",
where primary_product
is a primary energy carrier.
Example: "Resources [of Crude oil]".
r colorize("blue", 'With country: "Resources [of Crude oil in SAU]".')
The R matrix has products (energy carriers) in columns. All column names in the R matrix have the same form:
primary_product
[from Resources]",
where primary_product
is a primary energy carrier.
Example: "Crude oil [from Resources]".
r colorize("blue", 'With country: "Crude oil [from Resources in SAU]".')
Like the R matrix, the V matrix has industries (processing stages) in rows. There are several options for names of rows in the V matrix.
product
]", where product
is a primary or final
energy product.
Example: "Imports [of Crude oil]".
r colorize("blue", 'With country: "Imports [of Crude oil into USA]".')
product
]", where product
is a primary or
final energy carrier.
Example: "Stock changes [of Crude oil]".
r colorize("blue", 'With country: "Stock changes [of Crude oil in SAU]".')
pf_machine
", where pf_machine
is
a machine that converts primary energy to final energy.
These data come from the IEA's extended energy balances.
Example: "Oil refineries".
r colorize("blue", 'With country: "Oil refineries [in SAU]".')
r colorize("blue", 'With country: "Statistical differences [in SAU]".')
product
]", where product
is any
energy carrier. These processes are inserted to convert
Resources into primary products.
Example: "Manufacture [of Hydro]".
r colorize("blue", 'With country: "Manufacture [of Hydro in ISL]".')
fu_machine
-> useful_product
",
where fu_machine
is the name of a machine that converts final energy
into useful energy and useful_product
is the name of a useful energy product.
Example: "LPG stoves -> MTH.200.C".
r colorize("red", 'fu_machine [-> useful_product]')
r colorize("blue", 'With country: "LPG stoves [-> MTH.200.C in GHA]".')
Like the R matrix, the V matrix has products (energy carriers) in columns. There are two options for names of columns in the V matrix.
product
" where product
is the
unmodified name of the energy carrier in the IEA extended energy balances.
Example: "Anthracite".
r colorize("blue", 'With country: "Anthracite [in AUS]".')
useful_product
[from fu_machine
]",
where useful_product
is a useful energy carrier and fu_machine
is a
final-to-useful machine.
Example: "HPA [from Air compressors]"
r colorize("blue", 'With country: "HPA [from Air compressors in USA]".')
The U matrix has products (energy carriers) in rows.
primary_product
[from Resources]", where
primary_product
is a primary energy carrier.
Example: "Biogasoline [from Resources]".
r colorize("blue", 'With country: "Biogasoline [from Resources in USA]".')
product
", where product is a primary
or final energy carrier.
Example: "Electricity".
r colorize("blue", 'With country: "Electricity [in GBR]".')
useful_product
[from fu_machine
]"], where
useful_product
is a useful energy carrier and
fu_machine
is a final-to-useful machine.
Example: "HPL [from Electric pumps]".
r colorize("blue", 'With country: "HPL [from Electric pumps in ESP]".')
The U matrix has industries (processing stages) in columns.
pf_machine
" where pf_machine
is the name
of a primary-to-final machine.
Example: "Blast furnaces"
r colorize("blue", 'With country: "Blast furnaces [in USA]".')
fu_machine
-> useful_product
", where
fu_machine
is a final-to-useful machine and
useful_product
is a useful energy carrier.
r colorize("red", 'fu_machine [-> useful_product]')
r colorize("blue", 'With country: "Ammonia synthesizers [-> HTH.400.C in POL]".')
Like the U matrix, the Y matrix has products (energy carriers) in rows.
product
", where product
is the
unmodified name of the energy carrier in the IEA extended energy balances.
Example: "Naptha".
r colorize("blue", 'With country: "Naptha [in ESP]".')
product
[from fu_machine
]", where product
is a useful
energy carrier and fu_machine
is a final-to-useful machine.
Example: "RoP [from Electric cars]".
r colorize("blue", 'With country: "RoP [from Electric cars in USA]".')
Like the U matrix, the Y matrix has industries (final demand sectors) in columns.
sector
", where sector
is the name of a final demand sector,
unmodified from the IEA extended energy balances.
Example: "Construction".
r colorize("blue", 'With country: "Construction [in USA]".')
product
]", where product
is a primary or final
energy product.
Example: "Exports [of Coking coal]".
r colorize("blue", 'With country: "Exports [of Coking coal from USA]".')
bunker_type
bunkers [of product
]", where
bunker_type
is either "marine" or "aviation" and product
is a
(typically) final energy product.
Example: "Exports to World marine bunkers [of Biodiesels]".
r colorize("blue", 'With country: "Exports to World marine bunkers
[of Biodiesels from USA]".')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.