Scripts
View or edit on GitHub
This page is synchronized from trase/products/analysis/reports/manuscripts/2018_ZDC_MONITORING/SCRIPTS/README.md. Last modified on 2025-12-15 23:00 CET by Trase Admin.
Please view or edit the original file there; changes should be reflected here after a midnight build (CET time),
or manually triggering it with a GitHub action (link).
Explanation of the data and code used for the ERL manuscript:
"Using supply chain data to monitor zero deforestation commitments: an assessment of progress in the Brazilian soy sector"
This analysis consists of three scripts:
01_PREPARE_DATA.R - Loads the data (from a user-specified location) and then produces summary data which are called in subsequent scripts.
02_PLOT_FIGURES.R - Reproduces all figures in the manuscript.
03_KEY_STATISTICS.R - Reproduces all statistics quoted in the manuscript, which are based on the Trase data.
The zdc-monitoring.rdata contains the following objects:
am_biome - an sf object: the Amazon biome border.
amsterdam - a character vector: the names of Amsterdam Declaration signatories.
biomes - an sf object: biome borders in Brazil.
brazil_soy - a tbl of the V2.4 SEI-PCS data for Brazilian soy (source: https://trase.earth/).
Column names in brazil_soy called in this script are:
YEAR- the year of export.SOY_TONS- the tons of soybean equivalents per flow.EXPORTER- the exporter handling each flow of soy.COUNTRY- the country of destination.GEOCODE- the municipal geocode for the origin of each flow.GEOCODE_1- the geocode of the 'logistic hub' handling each flow.SOY_DEF_5_YEAR_HA- the soy deforestation risk.
companies_with_ZDC_pledges - a tbl containing the names of companies making zero deforestation commitments (ZDCs) and the year of that commitment.
deforestation - a tbl with the area of 'soy deforestation' per year: i.e. the area of soy planted on land deforested within the previous five years. This data is lagged by one year - so 2016 SOY_EXPORT_YEAR refers to soy planted in 2015 (to account for the delay between soy harvest and export).
dist_matrix_200km - a tbl with the distance between the centroids of all pairs of municipalities in Brazil, filtered to include only pairs where the distance is less than 200km. This is used in the sensitivity analysis.
eu - a character vector: the names of Eureopean Union country members (as of 2018).
matopiba - a character vector: the geocodes of all municipalities in the Matopiba region.
matopiba_outline - an sf object: the Matopiba border.
mt_Am - an sf object: the Amazon border within the state of Mato Grosso.
mt_Ce- an sf object: the Cerrado within the state of Mato Grosso
muni_biomes - a tbl containing municipal geocodes and the biome which makes up a majority of its area.
munis - an sf object: municipal borders in Brazil.
NYDF - a character vector: country signatories of the New York Declaration on Forests.
pam_soy_production - a tbl with the volume of soy harvested per municipality per year (original source: https://sidra.ibge.gov.br/pesquisa/pam/tabelas)
sm_signatories - a tbl containing the names of companies making zero deforestation commitments (ZDCs) and the year the commitment was made/joined.
state_dic - a tbl containing the names and codes of states in Brazil.
Plotting objects:
glencore_palette - colours used in plot of Glencore's sourcing.
my_zdc_facet_theme - a theme used for plotting.
my_zdc_facet_theme_grey - a theme used for plotting.
zdc_coverage_cols - colours used to designate different ZDCs.
zdc_yes_no_cols - colours used to designate different zero deforestation commitments.
Note
To recreate our results, the user must first specify the location of the project's .rdata file in the object location_of_data inside the script 01_PRE_PROCESS_DATA.R.
Contact erasmus.zuermgassen@uclouvain.be with questions.