Convert to PSUT matrices
make_iea_psut.Rd
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.
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
.
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"))
#> # A tibble: 4 × 13
#> Country Method Energy.type Last.stage Year Y S_units R
#> <chr> <chr> <chr> <chr> <dbl> <list> <list> <list>
#> 1 GHA PCM E Final 1971 <dbl [12 × 21]> <dbl[…]> <dbl[…]>
#> 2 GHA PCM E Final 2000 <dbl [13 × 20]> <dbl[…]> <dbl[…]>
#> 3 ZAF PCM E Final 1971 <dbl [19 × 27]> <dbl[…]> <dbl[…]>
#> 4 ZAF PCM E Final 2000 <dbl [22 × 43]> <dbl[…]> <dbl[…]>
#> # ℹ 5 more variables: U <list>, U_feed <list>, U_EIOU <list>, r_EIOU <list>,
#> # V <list>