Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions data-raw/bln_meas.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
omschrijving,thema,effect_omschrijving,bodem_gerelateerd,esd,effect,reductie_nh3,recuctie_ch4,reductie_n2o,daling_no3_(mg/l),esd_prod,esd_water_quant,esd_water_qual,esd_nutcycle,esd_climate,esd_biodiv,landgebruik,bodemtype,chemistry,physics,biology,gw_quantity,gw_quality,sw_quantity,sw_quality,climate,macronutrient
"Maximaliseer de inzet van vanggewassen na alle akker- en tuibouwteelten, met uitzondering na suikerbiet, zetmeelaardappel, lelie en voorafgaand aan wintergraan, en corrigeer de N-gift van het volggewas.",Grondwaterkwaliteit,"","",,++,"","","",1-24,0,0,2,0-1,1,1,"","",0,0,0,-1,2,-1,2,0,0-1
"Maximaliseer de inzet van vanggewassen na alle akker- en tuibouwteelten, met uitzondering na suikerbiet, zetmeelaardappel, lelie en voorafgaand aan wintergraan, en zonder correctie gebruiksnorm volggewas",Grondwaterkwaliteit,"","",,+,"","","",0-16,0,0,1,0-1,1,1,"","",0,0,0,-1,1,-1,1,0,0-1
Vaste rijpaden,"","","",,"","","","","",0-2,1-2,0-1,0-1,0-1,1,BLD,Zand,0,1,0,0,0,0,0,0,0-1
Onderzaai,"","","",,"","","","","",-1-1,0-1,0-2,0-2,0-1,1,BLD,Zand,0,0,0,-1,2,-1,2,0,0-2
Gewasresten achterlaten (stro),"","","",,"","","","","",0,0-1,-1-1,0-1,1-2,1,BLD,Zand,0,0,0,0,-1-0,0,-1-0,1,0-1
Gebruikt dierlijke mest niet/nauwlijks in najaar,"","","",,"","","","","",0-1,0-1,0-1,0-1,0,0,GLD,Zand,0,0,0,0,0,0,0,0,0-1
Vaste rijpaden,"","","",,"","","","","",0-2,1-2,0-1,0-1,0-1,1,BLD,Klei,0,1,0,0,0,0,0,0,0-1
Onderzaai,"","","",,"","","","","",-2,-2,1,0-2,?,?,BLD,Klei,0,0,0,-1,2,-1,2,0,0-2
Gewasresten achterlaten (stro),"","","",,"","","","","",0,0-1,-1-1,0-1,1-2,1,BLD,Klei,0,0,0,0,-1-0,0,-1-0,1,0-1
Gebruikt dierlijke mest niet/nauwlijks in najaar,"","","",,"","","","","",0,?,0-1,0-1,0,0,GLD,Klei,0,0,0,0,0,0,0,0,0-1
58 changes: 58 additions & 0 deletions data-raw/bln_measures.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# make a table with measures for BLN
# read data =====
d1 <- fread('data-raw/indicators_and_ess.csv', sep = ';', dec = ',')
d2 <- fread('data-raw/measures.csv', sep = ';', dec = ',')

# subset measures =====
m1 <- d2[grepl('Gebruikt dierlijke mest|Gewasresten ac|Onderzaai|Vaste rijpa|Maximaliseer de inzet', Omschrijving)]

# format measures table
setnames(m1, names(m1), tolower(gsub(' ', '_', names(m1))))

# assign numeric effect per topic when missing =====
m1[!`daling_no3_(mg/l)` == '', water_zuivering := fifelse(effect == '++', 2, 1)]
m1[grepl('vanggewas', omschrijving) & habitat_biodiversiteit == '', habitat_biodiversiteit := '1']
m1[grepl('vanggewas', omschrijving) & koolstof_vastlegging == '', koolstof_vastlegging := '1']
m1[grepl('vanggewas', omschrijving) & recycling_nutriënten == '', recycling_nutriënten := '0-1']
m1[grepl('vanggewas', omschrijving) & opbrengst == '', opbrengst := '0']
m1[grepl('vanggewas', omschrijving) & water_regulatie == '', water_regulatie := '0']

# reshape
# mm <- melt(m1, id.vars = c('omschrijving', 'landgebruik', 'bodemtype'),
# measure.vars = c('opbrengst', 'water_regulatie', 'water_zuivering', 'recycling_nutriënten', 'koolstof_vastlegging', 'habitat_biodiversiteit'))
mm <- copy(m1)

# add esd themes =====
# hdt <- data.table(
# variable = c('opbrengst', 'water_regulatie', 'water_zuivering', 'recycling_nutriënten', 'koolstof_vastlegging', 'habitat_biodiversiteit'),
# esd_thema = c('esd_prod', 'esd_water', 'esd_water', 'esd_nutcycle', 'esd_climate', 'esd_biodiv')
# )
mm <- merge(mm, hdt, by = 'variable')
setnames(mm, c('opbrengst', 'water_regulatie', 'water_zuivering', 'recycling_nutriënten', 'koolstof_vastlegging', 'habitat_biodiversiteit'),
c('esd_prod', 'esd_water_quant', 'esd_water_qual', 'esd_nutcycle', 'esd_climate', 'esd_biodiv'))


## add subgroup =====
mm[, chemistry := '0']
mm[grepl('rijpaden', omschrijving), physics := '1']
mm[is.na(physics), physics := '0']
mm[, biology := '0']
mm[, gw_quantity := fifelse(grepl('vanggewassen|nderzaai', omschrijving), '-1', '0')]

mm[grepl('N-gift|nderzaai|niet/nauwelijks in najaar', omschrijving), gw_quality := '2']
mm[grepl('zonder correctie gebruik', omschrijving), gw_quality := '1']
mm[grepl('resten achterlaten', omschrijving), gw_quality := '-1-0']
mm[is.na(gw_quality), gw_quality := '0']

mm[, sw_quantity := fifelse(grepl('vanggewassen|nderzaai', omschrijving), '-1', '0')]
mm[grepl('N-gift|nderzaai|niet/nauwelijks in najaar', omschrijving), sw_quality := '2']
mm[grepl('zonder correctie gebruik', omschrijving), sw_quality := '1']
mm[grepl('resten achterlaten', omschrijving), sw_quality := '-1-0']
mm[is.na(sw_quality), sw_quality := '0']

mm[, climate := fifelse(grepl('inzet vanggewassen|resten achterlaten', omschrijving), '1', '0')]
mm[, macronutrient := fifelse(grepl('nderzaai', omschrijving), '0-2', '0-1')]

bln_meas <- copy(mm)
usethis::use_data(bln_meas)
fwrite(bln_meas, 'data-raw/bln_meas.csv')
37 changes: 37 additions & 0 deletions data-raw/indicators_and_ess.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
naam;Rfun;variabele;esd_thema;sub_groep
NLV;BLN::bln_c_nitrogen;i_c_n;esd_prod;chemistry
P beschikbaarheid;BLN::bln_c_posphor;i_c_p;esd_prod;chemistry
K beschikbaarheid;BLN::bln_c_potassium;i_c_k;esd_prod;chemistry
Mg beschikbaarheid beoordeling;BLN::bln_c_magnesium;i_c_mg;esd_prod;chemistry
Zwavel levering;BLN::bln_c_sulfur;i_c_s;esd_prod;chemistry
Waardering delta pH;OBIC::ind_ph;I_C_PH;esd_prod;chemistry
Waardering delta pH;BLN::bln_c_ph;i_c_ph;esd_prod;chemistry
Verslempingsrisico waardering;OBIC::ind_sealing;i_p_se;esd_prod;physics
Droogtestresindex;OBIC::ind_waterstersindex;i_p_ds;esd_prod;physics
Natte stresindex;OBIC::ind_waterstersindex;i_p_ws;esd_prod;physics
Erodibiliteitsfactor index;BLN::bln_p_winderosion;i_p_du;esd_prod;physics
Ondergrondverdichtingscore;BLN::bln_p_compaction;i_p_co;esd_prod;physics
Ondergrondverdichtingscore;OBIC::ind_compaction;i_p_co;esd_prod;physics
Water holding capacity;BLN::bln_p_whc;i_p_whc;esd_prod;physics
Water holding capacity;OBIC_ind_waterretention;i_p_whc;esd_prod;physics
Aggregaatstabiliteitsindex;BLN::bln_p_aggstability;i_p_as;esd_prod;physics
Bewerkbaarheidsindex;OBIC::ind_workability;i_p_wo;esd_prod;physics
Ziektewerendheid index;OBIC::ind_resistance;i_b_di;esd_prod;biology
Mineraliseerbaar stikstof index;OBIC::ind_pmn;i_b_sf;esd_prod;biology
Grondwateraanvulling index;OBIC::ind_gw_target;i_e_gwr;esd_water;gw_quantity
Soil water content capacity;BLN::bln_bbwp_bw;i_gw_wb;esd_water;gw_quality
Weerstand tegen nitraatuitspoeling naar grondwater;BLN::bln_bbwp_ngw;i_gw_ngw;esd_water;gw_quality
Risico op pesticide uitspoeling;BLN::bln_wat_pesticide;i_gw_pest;esd_water;sw_quality
Het tegengaan van uitspoeling van toegediende stikstof naar grondwater;OBIC::ind_n_efficiency;i_e_gw_nlea;esd_water;gw_quality
Het tegengaan van uitspoeling van toegediende stikstof naar oppervlaktewater;OBIC::ind_n_efficiency;i_e_sw_nlea;esd_water;sw_quality
Voorkomen van stikstofuitspoeling uit de bodem;OBIC::ind_n_retention;i_e_gw_nret;esd_water;gw_quality
Voorkomen van stikstofuitspoeling uit de bodem;OBIC::ind_n_retention;i_e_sw_nret;esd_water;sw_quality
Stikstofreinigend vermogen naar oppervlaktewater;BLN::bln_bbwp_nsw;i_sw_nsw;esd_water;sw_quality
Fosfaatreinigend vermogen naar oppervlaktewater;BLN::bln_bbwp_psw;i_sw_psw;esd_water;sw_quality
Organischestof balans;OBIC::calc_sombalance;i_clim_osb;esd_climate;climate
Koolstofvastlegging;BLN::bln_clim_rothc;i_clim_rothc;esd_climate;climate
Veenafbraak;BLN::bln_clim_somers;i_clim_somers;esd_climate;climate
NUE-N;BLN::i_nut_nitrogen;i_nut_n;esd_nutcycle;macronutrient
NUE-P;BLN::i_nut_phosphorus;i_nut_p;esd_nutcycle;macronutrient
NUE-K;BLN::i_nut_potassium;i_nut_k;esd_nutcycle;macronutrient
NUE;bln_nut_nue;i_nut_nue;esd_nutcycle;macronutrient
Loading