Package: whep 0.3.0.9000

Catalin Covaci

whep: Processing Agro-Environmental Data

A set of tools for processing and analyzing data developed in the context of the "Who Has Eaten the Planet" (WHEP) project, funded by the European Research Council (ERC). For more details on multi-regional input–output model "Food and Agriculture Biomass Input–Output" (FABIO) see Bruckner et al. (2019) <doi:10.1021/acs.est.9b03554>.

Authors:Catalin Covaci [aut, cre], Eduardo Aguilera [aut, cph], Alice Beckmann [aut], Juan Infante [aut], Justin Morgan [aut], João Serra [ctb], European Research Council [fnd]

whep_0.3.0.9000.tar.gz
whep_0.3.0.9000.zip(r-4.7-any)whep_0.3.0.9000.zip(r-4.6-any)whep_0.3.0.9000.zip(r-4.5-any)
whep_0.3.0.9000.tgz(r-4.6-any)whep_0.3.0.9000.tgz(r-4.5-any)
whep_0.3.0.9000.tar.gz(r-4.7-any)whep_0.3.0.9000.tar.gz(r-4.6-any)
whep_0.3.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
whep/json (API)

# Install 'whep' in R:
install.packages('whep', repos = c('https://eduaguilera.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/eduaguilera/whep/issues

Pkgdown/docs site:https://eduaguilera.github.io

Datasets:

On CRAN:

Conda:

agriculturebiogeochemistrybiophysical-modelingcarboncropsenvironmentfootprintsland-uselivestocknitrogennutritionphosphorusplanetary-boundariesquantitative-historysocial-metabolismwater

5.90 score 1 stars 7 scripts 183 downloads 125 exports 61 dependencies

Last updated from:0800c15ae4. Checks:7 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64NOTE282
source / vignettesOK293
linux-release-x86_64NOTE264
macos-release-arm64NOTE135
macos-oldrel-arm64NOTE204
windows-devel-x86_64NOTE249
windows-release-x86_64NOTE354
windows-oldrel-x86_64NOTE358
wasm-releaseOK144

Exports:add_area_codeadd_area_nameadd_footprint_product_stageadd_item_cbs_codeadd_item_cbs_nameadd_item_prod_codeadd_item_prod_nameadd_polity_codeaggregate_grass_to_polityalign_extensionallocate_grazing_to_productsallocate_manure_to_landallocate_manure_transportapply_management_lossesassert_footprint_invariantsattach_provenanceattach_scopeattribute_fallow_to_cropsbalance_io_flowsbalance_rasbuild_cbs_pricesbuild_commodity_balancesbuild_constant_territory_seriesbuild_crop_land_extensionbuild_crop_soil_n2o_extensionbuild_cropgrids_land_extensionbuild_detailed_tradebuild_energy_co2_extensionbuild_fao_arable_fallow_extensionbuild_feed_demandbuild_feed_intake_localbuild_footprintbuild_grass_availabilitybuild_grass_availability_lpjmlbuild_grassland_land_extensionbuild_grazing_feed_footprintbuild_gridded_landusebuild_gridded_livestockbuild_hayr_land_extensionbuild_io_modelbuild_land_balance_footprintbuild_livestock_ghg_extensionbuild_livestock_nutrient_flowsbuild_primary_pricesbuild_primary_productionbuild_processing_coefsbuild_residue_feed_availbuild_supply_usebuild_trade_pricescalculate_bnfcalculate_cohorts_systemscalculate_crop_bnfcalculate_crop_nppcalculate_crop_npp_componentscalculate_crop_residuescalculate_crop_rootscalculate_enteric_ch4calculate_livestock_emissionscalculate_lmdicalculate_manure_emissionscalculate_nonsymbiotic_bnfcalculate_npp_carbon_nitrogencalculate_nue_cropscalculate_nue_livestockcalculate_potential_nppcalculate_residue_destiniescalculate_system_nuecalculate_uncertainty_boundscalculate_weed_bnfcheck_footprint_conservationcheck_series_jumpscheck_supply_use_balancecombine_covcompare_footprint_methodscompute_footprintcompute_footprint_balancecompute_footprint_pathscompute_fp_product_pathscompute_leontief_inverseconsolidate_sourcescreate_n_nat_destinycreate_n_productioncreate_n_prov_destinycreate_n_soil_inputsdecompose_weighted_ratioestimate_energy_demandestimate_n_excretionexpand_trade_sourcesfill_linearfill_proxy_growthfill_sumfootprint_scopefootprint_sensitivityget_arable_permanent_landget_bilateral_tradeget_crop_land_extensionget_faostat_dataget_feed_intakeget_polity_geometriesget_primary_productionget_primary_residuesget_processing_coefsget_provenanceget_scopeget_wide_cbsgrass_access_sharesgridded_fallow_weightsharmonize_interpolateharmonize_simplemake_lpjml_covariatemelt_bilateral_tradeplot_footprint_sankeyprepare_livestock_emissionspropagate_fp_uncertaintyread_lpjml_grass_productivityrecord_provenanceredistribute_feedrun_spatializesplit_manure_managementsummarise_conservationsummarize_bnfwhep_clear_cachewhep_coef_tablewhep_list_file_versionswhep_read_file

Dependencies:arrowaskpassassertthatbitbit64classclassIntclicliprcpp11crayoncurldata.tabledigestdplyre1071FAOSTATfsgenericsgluehmshttrjsonliteKernSmoothlabelinglatticelifecyclemagrittrMASSMatrixmimenanoparquetopensslpillarpinspkgconfigplyrprettyunitsprogressproxypurrrR6rappdirsRcppreadrRJSONIOrlangstringistringrsystibbletidyrtidyselecttzdbutf8vctrsvroomwhiskerwithryamlzoo

Trade sources year coverage

Last update: 2026-07-24
Started: 2025-01-13

Environmental footprint analysis
What is a footprint analysis? | The three-step pipeline | Concepts and terminology | Supply-use tables and process groups | Mixed units in the supply-use system | Bilateral trade | Commodity balance sheets (CBS) | The Z matrix (inter-industry flows) | Trade shares | The Y matrix (final demand) | The X vector (total output) | FABIO adjustments | The Leontief inverse (L) | Environmental extensions | The footprint | Running the analysis | Step 1: Build the IO model | Step 2: Compute the Leontief inverse | For large systems | Step 3: Compute the footprint | Dense path (pre-computed L, small systems) | Using Z directly (large systems) | With and without fd_labels | Analysing the results | A conservation check | Processing multiple years | Parallel execution (optional) | Summary | References

Last update: 2026-06-24
Started: 2026-06-08

Readme and manuals

Help Manual

Help pageTopics
Get area codes from area namesadd_area_code
Get area names from area codesadd_area_name
Add a final-demand product-area stage to footprints.add_footprint_product_stage
Get commodity balance sheet item codes from item namesadd_item_cbs_code
Get commodity balance sheet item names from item codesadd_item_cbs_name
Get production item codes from item namesadd_item_prod_code
Get production item names from item codesadd_item_prod_name
Add WHEP polity codes to a tableadd_polity_code
Aggregate gridded grass availability to polity totals.aggregate_grass_to_polity
Align an extension table to input-output sector labels.align_extension
Allocate grazing land forward to livestock products.allocate_grazing_to_products
Allocate field-available manure to cropland and grassland by crop.allocate_manure_to_land
Spill surplus manure to neighbouring cells with spare capacity.allocate_manure_transport
Animal codes and classificationsanimals_codes
Apply IPCC manure-management losses to the collected manure streams.apply_management_losses
Assert that footprint conservation invariants hold.assert_footprint_invariants
Attach a provenance record to a result.attach_provenance
Attach a scope record to a result.attach_scope
Attribute reported fallow land to crops.attribute_fallow_to_crops
Balance input-output flows so the footprint conserves.balance_io_flows
Balance a matrix to target margins by RAS.balance_ras
Biomass coefficients for crops and livestock productsbiomass_coefs
Build CBS item pricesbuild_cbs_prices
Build commodity balance sheetsbuild_commodity_balances
Build a constant-territory time series for a reference year's boundariesbuild_constant_territory_series
Build per-crop physical cropland extension.build_crop_land_extension
Build the crop/soil N2O extension.build_crop_soil_n2o_extension
Build a per-crop physical land extension from CROPGRIDS.build_cropgrids_land_extension
Build detailed bilateral trade matrixbuild_detailed_trade
Build the livestock energy-use CO2 footprint extension (meat only).build_energy_co2_extension
Build a per-crop physical land extension with FAO fallow-inclusive arable land.build_fao_arable_fallow_extension
Build livestock feed demand.build_feed_demand
Build local (per-cell) feed intake, chunked by year.build_feed_intake_local
Compute a footprint end-to-end from an extension table.build_footprint
Build grazable grass availability.build_grass_availability
Build grazable grass availability from an LPJmL run.build_grass_availability_lpjml
Build the native grassland land extension.build_grassland_land_extension
Build a grazing-land footprint by forward feed-allocation.build_grazing_feed_footprint
Build gridded landuse datasetbuild_gridded_landuse
Build gridded livestock datasetbuild_gridded_livestock
Build a hectare-year (land-occupation) crop land extension.build_hayr_land_extension
Build multi-regional input-output model.build_io_model
Build a consumption land footprint by physical trade balance.build_land_balance_footprint
Build the livestock greenhouse-gas emissions extension.build_livestock_ghg_extension
Build livestock nutrient flows from realised feed intake.build_livestock_nutrient_flows
Build primary item pricesbuild_primary_prices
Build primary production datasetbuild_primary_production
Build processing coefficientsbuild_processing_coefs
Build residue feed availability for feed allocation.build_residue_feed_avail
Supply and use tablesbuild_supply_use
Build global trade pricesbuild_trade_prices
Estimate total biological nitrogen fixation.calculate_bnf
Calculate cohort and production system distribution.calculate_cohorts_systems
Estimate symbiotic biological nitrogen fixation by crop legumes.calculate_crop_bnf
Estimate total crop net primary production.calculate_crop_npp
Estimate cropland NPP components including weeds.calculate_crop_npp_components
Estimate crop above-ground residue biomass.calculate_crop_residues
Estimate crop below-ground (root) biomass.calculate_crop_roots
Calculate enteric methane emissions.calculate_enteric_ch4
Calculate all livestock emissions.calculate_livestock_emissions
Calculate LMDI decomposition.calculate_lmdi
Calculate manure emissions (CH4 + N2O).calculate_manure_emissions
Estimate non-symbiotic biological nitrogen fixation.calculate_nonsymbiotic_bnf
Partition crop and weed NPP into dry matter, carbon and nitrogen.calculate_npp_carbon_nitrogen
N soil inputs and Nitrogen Use Efficiency (NUE) for cropcalculate_nue_crops
NUE for Livestockcalculate_nue_livestock
Estimate potential net primary production.calculate_potential_npp
Estimate the destinies of crop residues.calculate_residue_destinies
System NUEcalculate_system_nue
Calculate uncertainty bounds for livestock emissions.calculate_uncertainty_bounds
Estimate symbiotic biological nitrogen fixation by weeds and cover crops.calculate_weed_bnf
Commodity balance sheet processing fractionscb_processing
CBS to trade item code mappingcbs_trade_codes
FAOSTAT crop to LPJmL crop functional type (CFT) mappingcft_mapping
Check footprint conservation against direct extensions.check_footprint_conservation
Flag implausible year-on-year jumps in a time series.check_series_jumps
Check the commodity balance sheet supply-use identity.check_supply_use_balance
Climate-zone MCF values.climate_mcf
Combine independent coefficient-of-variation components.combine_cov
Compare two footprint estimates.compare_footprint_methods
Compute environmental footprints.compute_footprint
Compute land footprints by physical trade balance.compute_footprint_balance
Compute first-use footprint paths.compute_footprint_paths
Compute final-product footprint paths.compute_fp_product_paths
Compute Leontief inverse.compute_leontief_inverse
Consolidate a multi-source panel to one winning row per cell.consolidate_sources
Bouwman feed conversion ratios.conv_bouwman
Krausmann per head feed intake.conv_krausmann
GRAFS Nitrogen (N) flows at Spain national levelcreate_n_nat_destiny
N production for Spaincreate_n_production
GRAFS Nitrogen (N) flowscreate_n_prov_destiny
Nitrogen (N) soil inputs for Spaincreate_n_soil_inputs
Eurostat crop classification codescrops_eurostat
Manure nitrogen application by crop and countrycrops_manure_n
Decompose a weighted aggregate ratio.decompose_weighted_ratio
Estimate energy demand (Gross Energy) - Tier 2estimate_energy_demand
Estimate livestock nitrogen, carbon and volatile-solids excretion.estimate_n_excretion
Trade data sourcesexpand_trade_sources
Feed characteristics by diet quality.feed_characteristics
Feed taxonomy.feed_taxonomy
Fill gaps by linear interpolation, or carrying forward or backward.fill_linear
Fill gaps using growth rates from proxy variablesfill_proxy_growth
Fill gaps summing the previous value of a variable to the value of another variable.fill_sum
Describe the scope of a footprint result.footprint_scope
Local sensitivity of a footprint to each extension.footprint_sensitivity
Physical arable and permanent-crop land base (fallow-inclusive).get_arable_permanent_land
Bilateral trade dataget_bilateral_trade
Get the per-crop physical cropland extension from spatialization inputs.get_crop_land_extension
Scrape activity data from FAOSTAT and post-process itget_faostat_data
Livestock feed intakeget_feed_intake
Get WHEP polity geometriesget_polity_geometries
Primary items productionget_primary_production
Crop residue itemsget_primary_residues
Processed products share factorsget_processing_coefs
Retrieve a result's provenance record.get_provenance
Retrieve a result's scope record.get_scope
Commodity balance sheet data.get_wide_cbs
GLEAM animal weights.gleam_animal_weights
Nitrogen parameters for crop residues of feed materials.gleam_crop_residue_nitrogen
GLEAM crop residue parameters.gleam_crop_residue_params
GLEAM dressing percentages.gleam_dressing_percentages
Energy use emission factors for livestock production.gleam_energy_use_ef
GLEAM enteric fermentation parameters.gleam_enteric_params
GLEAM feed categories.gleam_feed_categories
GLEAM feed use efficiency.gleam_feed_composition
GLEAM feed conversion ratios for monogastrics.gleam_feed_conversion_ratios
GLEAM feed digestibility for ruminants.gleam_feed_digestibility
Emission factors for field operations on feed materials.gleam_field_operation_ef
Country-level fraction of crop residues removed.gleam_fracremove
GLEAM geographic hierarchy.gleam_geographic_hierarchy
GLEAM livestock categories.gleam_livestock_categories
Country-level mechanization levels for feed materials.gleam_mechanization_levels
GLEAM milk production.gleam_milk_production
GLEAM manure management system shares.gleam_mms_shares
Processing and transport emission factors for feeds.gleam_processing_transport_ef
Accessibility and conversion parameters for grazable grass availability.grass_access_shares
Grazing energy coefficients.grazing_energy_coefs
Build agro-climatic, rainfed-gated fallow allocation weights.gridded_fallow_weights
Harmonize advanced cases with interpolation for 1:N groupsharmonize_interpolate
Harmonize rows labeled "simple" by summing valuesharmonize_simple
Indirect N2O emission factors.indirect_n2o_ef
IPCC 2006 Tier 1 enteric emission factors.ipcc_2006_enteric_ef
IPCC 2006 Tier 1 manure emission factors.ipcc_2006_manure_ef
IPCC 2006 MCF by temperature.ipcc_2006_mcf_temp
IPCC 2019 Bo values (Table 10.16).ipcc_2019_bo
IPCC 2019 Cfi values (Table 10.4).ipcc_2019_cfi
IPCC 2019 enteric EF for cattle.ipcc_2019_enteric_ef_cattle
IPCC 2019 enteric EF for non-cattle.ipcc_2019_enteric_ef_other
IPCC 2019 manure CH4 EF for cattle.ipcc_2019_manure_ch4_ef_cattle
IPCC 2019 manure CH4 EF for non-cattle.ipcc_2019_manure_ch4_ef_other
IPCC 2019 MCF for manure management.ipcc_2019_mcf_manure
IPCC 2019 nitrogen excretion rates.ipcc_2019_n_excretion
IPCC 2019 direct N2O emission factors.ipcc_2019_n2o_ef_direct
IPCC 2019 Ym values (Table 10.12).ipcc_2019_ym
Tier 2 Bo values.ipcc_tier2_bo_values
Tier 2 energy coefficients.ipcc_tier2_energy_coefs
Tier 2 manure ash content.ipcc_tier2_manure_ash
Tier 2 nitrogen retention fractions.ipcc_tier2_n_retention
Tier 2 Ym values.ipcc_tier2_ym_values
Commodity balance sheet itemsitems_cbs
Full CBS item tableitems_full
Primary production items linked to CBSitems_prim
Primary production itemsitems_prod
Full production item tableitems_prod_full
Grassland share of synthetic nitrogen by country and yearlassaletta_grassland_share
Livestock unit coefficientsliv_lu_coefs
Livestock physical constants.livestock_constants
Default production parameters.livestock_production_defaults
Build an LPJmL/WHEP spatial covariate functionmake_lpjml_covariate
Maximum intake shares.max_intake_share
Melt a bilateral trade matrix to long format.melt_bilateral_trade
Synthetic nitrogen application rates by crop and countrymueller_synthetic_n
Interactive footprint Sankey viewerplot_footprint_sankey
Politiespolities
Polity categories and regional classificationspolities_cats
FAOSTAT/FABIO area-to-polity crosswalkpolity_area_crosswalk
Prepare production data for livestock emission calculations.prepare_livestock_emissions
Items with double-counting in production statisticsprimary_double
Propagate input uncertainty through a footprint.propagate_fp_uncertainty
Read natural-grass productivity from an LPJmL run.read_lpjml_grass_productivity
Record provenance for a reproducible result.record_provenance
Redistribute available feed supply among livestock demand.redistribute_feed
Regional MMS distribution.regional_mms_distribution
Full polity and region reference tableregions_full
Run the gridded land-use spatialization pipelinerun_spatialize
Smil (2001) global synthetic nitrogen production, 1913-2000smil_2001_synthetic_n_global
Split livestock excretion across manure-management systems.split_manure_management
Summarise a footprint conservation report.summarise_conservation
Summarise biological nitrogen fixation results.summarize_bnf
Temperature adjustment factors for NEm.temperature_adjustment
Uncertainty ranges for emission parameters.uncertainty_ranges
Clear the build pipeline cachewhep_clear_cache
Read a WHEP coefficient table.whep_coef_table
External inputswhep_inputs
Input file versionswhep_list_file_versions
Download, cache and read fileswhep_read_file