Prep PFU data for conversion to PSUT matrices
add_row_col_meta.RdPrimary-final-useful (PFU) data need to be converted to PSUT matrices.
This function take the output of specify_last_stages()
and converts to PSUT matrices in a data frame.
Usage
add_row_col_meta(
.df,
biomass = MWTools::mw_products$biomass,
food = MWTools::mw_products$food,
feed = MWTools::mw_products$feed,
hu_mech = MWTools::mw_products$hu_mech,
an_mech = MWTools::mw_products$an_mech,
an_p = MWTools::mw_products$an_p,
resources = MWTools::mw_sectors$resources_sector,
farms = MWTools::mw_sectors$farms,
food_production = MWTools::mw_sectors$food_production,
feed_production = MWTools::mw_sectors$feed_production,
transport = MWTools::mw_sectors$transport_sector,
human_females = MWTools::mw_species$human_females,
human_males = MWTools::mw_species$human_males,
final = MWTools::all_stages$final,
useful = MWTools::all_stages$useful,
species = MWTools::mw_constants$species,
sector = MWTools::mw_constants$sector_col,
stage = MWTools::mw_constants$stage_col,
product = MWTools::mw_cols$product,
last_stage = MWTools::mw_cols$last_stage,
matnames = MWTools::mat_meta_cols$matnames,
rownames = MWTools::mat_meta_cols$rownames,
colnames = MWTools::mat_meta_cols$colnames,
rowtypes = MWTools::mat_meta_cols$rowtypes,
coltypes = MWTools::mat_meta_cols$coltypes,
R_name = MWTools::psut_cols$R,
U_name = MWTools::psut_cols$U,
V_name = MWTools::psut_cols$V,
Y_name = MWTools::psut_cols$Y,
industry_type = MWTools::row_col_types$industry,
product_type = MWTools::row_col_types$product,
product_notation = RCLabels::from_notation,
resource_notation = RCLabels::of_notation,
species_notation = RCLabels::arrow_notation
)Arguments
- .df
A data frame containing muscle work data, likely the output from
specify_last_stages().- biomass, food, feed, hu_mech, an_mech, an_p
See
MWTools::mw_products.- resources, farms, food_production, feed_production, transport
- human_females, human_males
See
MWTools::mw_species.- final, useful
See
MWTools::all_stages.- species, sector, stage
- product, last_stage
See
MWTools::mw_cols.- matnames, rownames, colnames, rowtypes, coltypes
- R_name, U_name, V_name, Y_name
See
MWTools::psut_cols.- industry_type, product_type
- product_notation
The notation for products. Default is
RCLabels::from_notation.- resource_notation
The notation for resources. Default is
RCLabels::of_notation.- species_notation
The notation for species. Default is
RCLabels::arrow_notation.
Examples
hmw_df <- hmw_test_data_path() %>%
read.csv() %>%
calc_hmw_pfu()
amw_df <- amw_test_data_path() %>%
read.csv() %>%
calc_amw_pfu()
specify_energy_type_method(hmw_df, amw_df) %>%
specify_product() %>%
specify_ktoe() %>%
MWTools::specify_primary_production() %>%
specify_useful_products() %>%
specify_fu_machines() %>%
specify_last_stages() %>%
MWTools::add_row_col_meta()
#> # A tibble: 15,372 × 16
#> Country Year Species Stage Sector Unit E.dot Energ…¹ Method Product
#> <chr> <dbl> <chr> <chr> <chr> <chr> <dbl> <chr> <chr> <chr>
#> 1 GBR 1960 Human females Prima… Agric… ktoe 33.4 E PCM Biomas…
#> 2 GBR 1960 Human females Prima… Indus… ktoe 593. E PCM Biomas…
#> 3 GBR 1960 Human females Prima… Servi… ktoe 1086. E PCM Biomas…
#> 4 GBR 1960 Human males Prima… Agric… ktoe 179. E PCM Biomas…
#> 5 GBR 1960 Human males Prima… Indus… ktoe 2190. E PCM Biomas…
#> 6 GBR 1960 Human males Prima… Servi… ktoe 1448. E PCM Biomas…
#> 7 GBR 1961 Human females Prima… Agric… ktoe 33.9 E PCM Biomas…
#> 8 GBR 1961 Human females Prima… Indus… ktoe 601. E PCM Biomas…
#> 9 GBR 1961 Human females Prima… Servi… ktoe 1100. E PCM Biomas…
#> 10 GBR 1961 Human males Prima… Agric… ktoe 181. E PCM Biomas…
#> # … with 15,362 more rows, 6 more variables: Last.stage <chr>, matnames <chr>,
#> # rownames <chr>, colnames <chr>, rowtypes <chr>, coltypes <chr>, and
#> # abbreviated variable name ¹Energy.type