Skip to contents

Data Loading

Load coefficients, classifications, and foundational data objects.

load_general_data()
Load General Data, Codes, Coefficients, and Vectors
load_vectors()
Load Color Palettes, Factor Levels, and Categorical Vectors

NPP Calculation Functions

Net Primary Productivity calculation and conversion functions.

calculate_potential_npp()
Calculate Potential Net Primary Production (NPP)
calculate_crop_npp()
Calculate Crop Net Primary Production Components
calculate_npp_dm_c_n()
Calculate NPP in Dry Matter, Carbon, and Nitrogen
calculate_crop_npp_components()
Calculate Cropland NPP Components Including Weeds

Impact Tracing Functions

Supply chain impact allocation and tracing functions.

Prepare_prim()
Impact Tracing Functions
Allocate_impacts_to_products()
Allocate Impacts to Products Based on Economic Value
get_global_export_footprint()
Get Global Average Export Footprint
calc_avail_fp_gt()
Calculate Available Footprint Using Gross Trade
calc_avail_fp_dtm()
Calculate Available Footprint Using Detailed Trade Matrix
Calc_impact_processed()
Calculate Embodied Impact of Processed Products
Agg_primary()
Aggregate Primary Products to CBS Items
Agg_processed()
Aggregate Processed Products from Countries to Origins

Analysis Functions

Specialized environmental impact calculations.

Calc_N_fix()
Biological Nitrogen Fixation Functions
Gases_GWP()
Classify GHG Emissions and Calculate Global Warming Potential
Calc_diets()
Calculate Nutrient Composition of Diets
get_herbwoody_fao()
Get Herbaceous and Woody Land from FAO
calculate_land_scaling()
Calculate Land Scaling Factors
scale_land()
Scale Land Area by Cropping Intensity

Main Workflow Functions

Complete footprint calculation pipelines.

calculate_footprints()
Calculate Complete Environmental Footprints Along Supply Chains
extract_luh2()
Extract Data from Land-Use Harmonization 2 (LUH2) Dataset

Biomass Processing Functions

Functions for biomass data processing including fallow integration and residue handling.

biomass_functions
Biomass Processing Functions
integrate_fallow()
Integrate Fallow Area into Cropland Area
residues_as_items()
Classify Residues as CBS Items
residue_use()
Calculate Residue Use from Crop NPP Data

Utility Functions

Helper functions for data manipulation and gap-filling.

utility_functions
Utility Functions for Data Manipulation
`%!in%`
Exclude operator
drop_cols()
Drop columns from data frame
is_empty()
Check if dataset is empty
Arrange_dates()
Arrange data by dates
add_xlsx_sheet()
Add sheet to existing Excel workbook
Filling()
Fill gaps in time series
FillingProxy()
Fill gaps using proxy variable
fill_na_with_sum()
Fill gaps with accumulated sum

Visualization Functions

Plotting themes and visualization utilities.

theme_new()
ggplot2 Themes for Scientific Plots
theme_nolabel()
ggplot2 Theme Without Labels
ggplotRegression()
Plot Linear Regression with Statistics

Data Objects

Data objects loaded by load_general_data(). See DATA_REFERENCE.md for details.

afsetools-data
Data Objects Loaded by load_general_data()
Biomass_coefs
Biomass Coefficients
GWP
Global Warming Potentials
BNF
Biological Nitrogen Fixation Parameters
items_full
Item Classifications
regions_full
Regional Classifications