Extracts industry level EROIs from tidy Input Output matrices
extract_tidy_industry_erois.Rd
The function extracts industry level EROIs from tidy Input Output matrices, in a tidy format.
Usage
extract_tidy_industry_erois(
.tidy_io_mats,
country = IEATools::iea_cols$country,
method = IEATools::iea_cols$method,
energy_type = IEATools::iea_cols$energy_type,
last_stage = IEATools::iea_cols$last_stage,
year = IEATools::iea_cols$year,
matnames = IEATools::mat_meta_cols$matnames,
matvals = IEATools::mat_meta_cols$matvals,
eroi_g_i = "eroi_g_i",
eroi_n_i = "eroi_n_i",
eroi_g_i_feed = "eroi_g_i_feed",
eroi_n_i_feed = "eroi_n_i_feed",
type = "Type",
boundary = "Boundary",
eroi = "EROI",
industry = "Industry_name",
colnames = "colnames",
rowtypes = "rowtypes",
coltypes = "coltypes"
)
Arguments
- .tidy_io_mats
The
.tidy_io_mats
data frame from which EROIs should be extracted.- country, method, energy_type, last_stage, year
See
IEATools::iea_cols
.- matnames
The column name of the column having matrices names. Default is
IEATools::mat_meta_cols$matnames
.- matvals
The column name of the column reporting matrices values, once expanded. Default is
IEATools::mat_meta_cols$matvals
.- eroi_g_i
The name of the column containing vectors of industry-level gross EROIs, including both energy use for feedstock and EIOU production. Default is "eroi_g_i".
- eroi_n_i
The name of the column containing vectors of industry-level net EROIs, including both energy use for feedstock and EIOU production. Default is "eroi_n_i".
- eroi_g_i_feed
The name of the column containing vectors of industry-level gross EROIs, including only energy use for feedstock production. Default is "eroi_g_i_feed".
- eroi_n_i_feed
The name of the column containing vectors of industry-level net EROIs, including only energy use for feedstock production. Default is "eroi_g_i_feed".
- type
The name of the EROI type column (i.e. gross or net EROI). Default is "Type".
- boundary
The name of the boundary column. Default is "Boundary".
- eroi
The name of the product EROI column in output. Default is "EROI".
- industry
The name of the industry column returned in the output data frame. Default is "Industry_name".
- colnames
The name of columns when expanding matrices. Default is "colnames".
- rowtypes
The name of row types when expanding matrices. Default is "rowtypes".
- coltypes
The name of column types when expanding matrices. Default is "coltypes".
Details
The function can be called after calculating EROIs through the Recca::calc_erois()
function.
The type column indicates whether the calculated EROI is gross or net.
The boundary column indicates whether the EROI includes:
Only energy use for feedstock production ("Feedstock");
Both energy use for feedstock production and for EIOU production ("All").
Examples
# Let's first have a look at the raw data obtained when calculating EROIs:
calculated_erois_raw <- ECCTools::tidy_AB_data %>%
IEATools::prep_psut() %>%
Recca::calc_io_mats() %>%
Recca::calc_E_EIOU() %>%
Recca::calc_erois() %>%
dplyr::glimpse()
#> Rows: 2
#> Columns: 39
#> $ Country <chr> "A", "B"
#> $ Method <chr> "PCM", "PCM"
#> $ Energy.type <chr> "E", "E"
#> $ Last.stage <chr> "Final", "Final"
#> $ Year <dbl> 2018, 2018
#> $ Y <list> <<matrix[9 x 6]>>, <<matrix[7 x 4]>>
#> $ S_units <list> <<matrix[12 x 1]>>, <<matrix[9 x 1]>>
#> $ R <list> <<matrix[4 x 4]>>, <<matrix[3 x 3]>>
#> $ U <list> <<matrix[11 x 7]>>, <<matrix[8 x 4]>>
#> $ U_feed <list> <<matrix[9 x 7]>>, <<matrix[5 x 4]>>
#> $ U_EIOU <list> <<matrix[5 x 7]>>, <<matrix[5 x 4]>>
#> $ r_EIOU <list> <<matrix[11 x 7]>>, <<matrix[8 x 4]>>
#> $ V <list> <<matrix[7 x 9]>>, <<matrix[4 x 6]>>
#> $ y <list> <<matrix[9 x 1]>>, <<matrix[7 x 1]>>
#> $ q <list> <<matrix[12 x 1]>>, <<matrix[9 x 1]>>
#> $ f <list> <<matrix[7 x 1]>>, <<matrix[4 x 1]>>
#> $ g <list> <<matrix[7 x 1]>>, <<matrix[4 x 1]>>
#> $ h <list> <<matrix[4 x 1]>>, <<matrix[3 x 1]>>
#> $ r <list> <<matrix[4 x 1]>>, <<matrix[3 x 1]>>
#> $ W <list> <<matrix[12 x 7]>>, <<matrix[9 x 4]>>
#> $ Z <list> <<matrix[11 x 7]>>, <<matrix[8 x 4]>>
#> $ K <list> <<matrix[11 x 7]>>, <<matrix[8 x 4]>>
#> $ C <list> <<matrix[9 x 7]>>, <<matrix[6 x 4]>>
#> $ D <list> <<matrix[7 x 12]>>, <<matrix[4 x 9]>>
#> $ A <list> <<matrix[11 x 12]>>, <<matrix[8 x 9]>>
#> $ O <list> <<matrix[4 x 4]>>, <<matrix[3 x 3]>>
#> $ L_pxp <list> <<matrix[12 x 12]>>, <<matrix[9 x 9]>>
#> $ L_ixp <list> <<matrix[7 x 12]>>, <<matrix[4 x 9]>>
#> $ Z_feed <list> <<matrix[9 x 7]>>, <<matrix[5 x 4]>>
#> $ K_feed <list> <<matrix[9 x 7]>>, <<matrix[5 x 4]>>
#> $ A_feed <list> <<matrix[9 x 12]>>, <<matrix[5 x 9]>>
#> $ L_pxp_feed <list> <<matrix[12 x 12]>>, <<matrix[9 x 9]>>
#> $ L_ixp_feed <list> <<matrix[7 x 12]>>, <<matrix[4 x 9]>>
#> $ E_EIOU <list> <<matrix[5 x 7]>>, <<matrix[5 x 4]>>
#> $ e_EIOU <list> <<matrix[7 x 1]>>, <<matrix[4 x 1]>>
#> $ eroi_g_p <list> <<matrix[12 x 1]>>, <<matrix[9 x 1]>>
#> $ eroi_g_i <list> <<matrix[7 x 1]>>, <<matrix[4 x 1]>>
#> $ eroi_g_p_feed <list> <<matrix[12 x 1]>>, <<matrix[9 x 1]>>
#> $ eroi_g_i_feed <list> <<matrix[7 x 1]>>, <<matrix[4 x 1]>>
# Let's then extract EROIs in a tidy format:
calculated_erois_raw %>%
extract_tidy_industry_erois() %>%
print()
#> # A tibble: 22 × 9
#> Country Method Energy.type Last.stage Year Type Boundary Industry_name
#> <chr> <chr> <chr> <chr> <dbl> <chr> <chr> <chr>
#> 1 A PCM E Final 2018 Gross All Blast furnaces
#> 2 A PCM E Final 2018 Gross All Coal mines
#> 3 A PCM E Final 2018 Gross All Coke ovens
#> 4 A PCM E Final 2018 Gross All Main activity pr…
#> 5 A PCM E Final 2018 Gross All Natural gas extr…
#> 6 A PCM E Final 2018 Gross All Oil extraction
#> 7 A PCM E Final 2018 Gross All Oil refineries
#> 8 A PCM E Final 2018 Gross Feedstock Blast furnaces
#> 9 A PCM E Final 2018 Gross Feedstock Coal mines
#> 10 A PCM E Final 2018 Gross Feedstock Coke ovens
#> # ℹ 12 more rows
#> # ℹ 1 more variable: EROI <dbl>