knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
In societal energy analysis and societal exergy analysis (SEA), animals and humans provide energy to society by performing muscle work. A previous study by @Steenwyk:2022ww developed and standardized ways to estimate muscle work contributed to society by animals and humans. And data exist from the UN's Food and Agriculture Organization (FAO) and the International Labor Organization (ILO) that could be used for such purposes. However, none of the data are in the PSUT format proposed by @Heun:2018. Computational tools are needed to gather and shape relevant data.
The examples below show how to use MWTools
to address
the needs described above.
Raw data for the estimation of animal muscle work is obtained from the Food and
Agriculture Organisation of the United Nations Statistical Database (FAOSTAT),
via the R
package FAOSTAT
as follows.
raw_amw_data <- FAOSTAT::get_faostat_bulk(code = "QCL", data_folder = tempdir())
The helper function calc_amw_pfu
returns a tidy data frame containing data for
the primary, final, and useful energy by species, country, year and in
the agriculture, transport, and total sectors.
test_amw_data <- read.csv(file = MWTools::amw_test_data_path()) amw_pfu_data <- MWTools::calc_amw_pfu(.df = test_amw_data, concordance_path = MWTools::fao_concordance_path(), amw_analysis_data_path = MWTools::amw_analysis_data_path()) tibble::glimpse(amw_pfu_data)
Raw data for the estimation of human muscle work is obtained from the
International Labor Organisation (ILO), via the R
package Rilostat
as
follows:
ilo_working_hours_data <- Rilostat::get_ilostat(id = MWTools::ilo_codes$working_hours_code, quiet = TRUE) |> Rilostat::label_ilostat(code = c("ref_area")) ilo_employment_data <- Rilostat::get_ilostat(id = MWTools::ilo_codes$employment_code, quiet = TRUE) |> Rilostat::label_ilostat(code = c("ref_area"))
Using data for the number of employed persons and mean yearly working hours the
primary, final, and useful energy associated with human muscle work can be
estimated using the helper function MWTools::calc_hmw_pfu
as below.
``` {r calc_hmw_example} ilo_working_hours_data <- read.csv(file = MWTools::ilo_working_hours_test_data_path()) ilo_employment_data <- read.csv(file = MWTools::ilo_employment_test_data_path())
preparedILOData <- MWTools::prepareRawILOData(ilo_working_hours_data = ilo_working_hours_data, ilo_employment_data = ilo_employment_data)
hmw_pfu_data <- MWTools::calc_hmw_pfu(.df = preparedILOData, concordance_path = MWTools::fao_concordance_path(), hmw_analysis_data_path = MWTools::hmw_analysis_data_path()) tibble::glimpse(hmw_pfu_data)
### PSUT matrices PFU data can be converted to PSUT matrices using `prep_psut()`. ```r mw_psut <- MWTools::prep_psut(.hmw_df = hmw_pfu_data, .amw_df = amw_pfu_data) tibble::glimpse(mw_psut)
The functions in the MWTools
package can streamline and assist inclusion
of animal and human muscle work in societal exergy analysis.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.