############################################################################
############################################################################
### ###
### SECTION 3: ###
### Farm | Supply details ###
### ###
############################################################################
############################################################################
#################################################################
## Setup ##
#################################################################
# set currently working directory
gdx.dir <- paste0(getwd(), "/inst/extdata/gdx")
# define gdx file name for reading
file1 <- "res_2_1230cap_after_2014_refdefaultA" # refdefautA
file2 <- "res_2_1230fta_import_bandefaultA" # bandefaultA
# loaded gdx files and saved in dataout
outdata.dir <- paste0(getwd(), "/inst/outdata")
# Step 1: extract supply details with longname
# activitySel: Crops, Cereals, Activities, anyThing, Oilseeds, Crop aggregates, Aggregates
bs <- extract_supply_details_longname (region_list= "EU27yr19",
dimdef_activity = dimdef_activity,
activitySel= "Cereals",
scenario_list= file1,
folder = gdx.dir)
sc <- extract_supply_details_longname (region_list= "EU27yr19",
dimdef_activity = dimdef_activity,
activitySel= "Cereals",
scenario_list= file2,
folder = gdx.dir)
# step 2
# calculate abs and percent change then output tables
supply_tb <- cal_diff_percentage_change(bs,sc,supply_details = TRUE)
# step 3