diff --git a/analysis/preprocessing/full_code_europe.inequality.Rmd b/analysis/preprocessing/full_code_europe.inequality.Rmd index 1f36bd067ae9e928950e4cd0ef51df2def277d34..69d4610a0ea99ddb59c0fe6ed8cd0804896df892 100644 --- a/analysis/preprocessing/full_code_europe.inequality.Rmd +++ b/analysis/preprocessing/full_code_europe.inequality.Rmd @@ -30,6 +30,7 @@ knitr::opts_chunk$set( if (!require("pacman")) install.packages("pacman") pacman::p_load(tidyverse, janitor, + readr, here, wbstats, ISOcodes, @@ -2064,217 +2065,6 @@ for (i in years_exb_ixi){ ZA) %>% select(TIV_energy_europe,TIV_energy_not_europe) - # biomass - - Exiobase_TIV_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_biomass_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_biomass_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_biomass_domestic) - - Exiobase_TIV_europe_breakdown_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_biomass_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_biomass_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_biomass_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_biomass_europe,TIV_biomass_not_europe) - - # construction materials - - Exiobase_TIV_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_const_materials_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_const_materials_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_const_materials_domestic) - - Exiobase_TIV_europe_breakdown_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_const_materials_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_const_materials_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_const_materials_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_const_materials_europe,TIV_const_materials_not_europe) - - # fossil fuels - - Exiobase_TIV_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_ffuels_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_ffuels_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_ffuels_domestic) - - Exiobase_TIV_europe_breakdown_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_ffuels_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_ffuels_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_ffuels_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_ffuels_europe,TIV_ffuels_not_europe) - - # ores - - Exiobase_TIV_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_ores_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_ores_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_ores_domestic) - - Exiobase_TIV_europe_breakdown_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_ores_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_ores_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_ores_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_ores_europe,TIV_ores_not_europe) - - # cropland - - Exiobase_TIV_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_cropland_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_cropland_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_cropland_domestic) - - Exiobase_TIV_europe_breakdown_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_cropland_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_cropland_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_cropland_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_cropland_europe,TIV_cropland_not_europe) - - # forest land - - Exiobase_TIV_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_forest_land_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_forest_land_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_forest_land_domestic) - - Exiobase_TIV_europe_breakdown_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_forest_land_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_forest_land_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_forest_land_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_forest_land_europe,TIV_forest_land_not_europe) - - # pasture land - - Exiobase_TIV_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_pasture_land_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_pasture_land_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_pasture_land_domestic) - - Exiobase_TIV_europe_breakdown_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_pasture_land_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_pasture_land_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_pasture_land_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_pasture_land_europe,TIV_pasture_land_not_europe) - - # join with labels TIV_with_labels = cbind(Exiobase_T_labels, @@ -2300,14 +2090,7 @@ for (i in years_exb_ixi){ t(Exiobase_TIV_sf6_bp), t(Exiobase_TIV_hfc_bp), t(Exiobase_TIV_pfc_bp), - t(Exiobase_TIV_energy_use_bp), - t(Exiobase_TIV_biomass_bp), - t(Exiobase_TIV_const_materials_bp), - t(Exiobase_TIV_ffuels_bp), - t(Exiobase_TIV_ores_bp), - t(Exiobase_TIV_cropland_bp), - t(Exiobase_TIV_forest_land_bp), - t(Exiobase_TIV_pasture_land_bp)) %>% + t(Exiobase_TIV_energy_use_bp)) %>% rename(TIV_CO2 = "t(Exiobase_TIV_co2_bp)", TIV_CO2_noncombustion_cement = "t(Exiobase_TIV_co2_noncombustion_cement_bp)", TIV_CO2_noncombustion_lime = "t(Exiobase_TIV_co2_noncombustion_lime_bp)", @@ -2330,14 +2113,7 @@ for (i in years_exb_ixi){ TIV_SF6 = "t(Exiobase_TIV_sf6_bp)", TIV_HFC = "t(Exiobase_TIV_hfc_bp)", TIV_PFC = "t(Exiobase_TIV_pfc_bp)", - TIV_energy = "t(Exiobase_TIV_energy_use_bp)", - TIV_biomass = "t(Exiobase_TIV_biomass_bp)", - TIV_const_materials = "t(Exiobase_TIV_const_materials_bp)", - TIV_ffuels = "t(Exiobase_TIV_ffuels_bp)", - TIV_ores = "t(Exiobase_TIV_ores_bp)", - TIV_cropland = "t(Exiobase_TIV_cropland_bp)", - TIV_forest_land = "t(Exiobase_TIV_forest_land_bp)", - TIV_pasture_land = "t(Exiobase_TIV_pasture_land_bp)") %>% + TIV_energy = "t(Exiobase_TIV_energy_use_bp)") %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year = as.character(rep(year_current,nrow(TIV_with_labels))) @@ -2375,14 +2151,7 @@ for (i in years_exb_ixi){ Exiobase_TIV_country_breakdown_sf6_bp %>% select(-country), Exiobase_TIV_country_breakdown_hfc_bp %>% select(-country), Exiobase_TIV_country_breakdown_pfc_bp %>% select(-country), - Exiobase_TIV_country_breakdown_energy_use_bp %>% select(-country), - Exiobase_TIV_country_breakdown_biomass_bp %>% select(-country), - Exiobase_TIV_country_breakdown_const_materials_bp %>% select(-country), - Exiobase_TIV_country_breakdown_ffuels_bp %>% select(-country), - Exiobase_TIV_country_breakdown_ores_bp %>% select(-country), - Exiobase_TIV_country_breakdown_cropland_bp %>% select(-country), - Exiobase_TIV_country_breakdown_forest_land_bp %>% select(-country), - Exiobase_TIV_country_breakdown_pasture_land_bp %>% select(-country)) %>% + Exiobase_TIV_country_breakdown_energy_use_bp %>% select(-country)) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK"), country = dplyr::recode(country, "GR" = "EL", "GB" = "UK")) @@ -2412,14 +2181,7 @@ for (i in years_exb_ixi){ TIV_SF6_domestic = as.numeric(TIV_SF6_domestic), TIV_HFC_domestic = as.numeric(TIV_HFC_domestic), TIV_PFC_domestic = as.numeric(TIV_PFC_domestic), - TIV_energy_domestic = as.numeric(TIV_energy_domestic), - TIV_biomass_domestic = as.numeric(TIV_biomass_domestic), - TIV_const_materials_domestic = as.numeric(TIV_const_materials_domestic), - TIV_ffuels_domestic = as.numeric(TIV_ffuels_domestic), - TIV_ores_domestic = as.numeric(TIV_ores_domestic), - TIV_cropland_domestic = as.numeric(TIV_cropland_domestic), - TIV_forest_land_domestic = as.numeric(TIV_forest_land_domestic), - TIV_pasture_land_domestic = as.numeric(TIV_pasture_land_domestic)) + TIV_energy_domestic = as.numeric(TIV_energy_domestic)) domestic_TIVs = rbind(domestic_TIVs, look_domestic) @@ -2448,14 +2210,7 @@ for (i in years_exb_ixi){ Exiobase_TIV_europe_breakdown_sf6_bp, Exiobase_TIV_europe_breakdown_hfc_bp, Exiobase_TIV_europe_breakdown_pfc_bp, - Exiobase_TIV_europe_breakdown_energy_use_bp, - Exiobase_TIV_europe_breakdown_biomass_bp, - Exiobase_TIV_europe_breakdown_const_materials_bp, - Exiobase_TIV_europe_breakdown_ffuels_bp, - Exiobase_TIV_europe_breakdown_ores_bp, - Exiobase_TIV_europe_breakdown_cropland_bp, - Exiobase_TIV_europe_breakdown_forest_land_bp, - Exiobase_TIV_europe_breakdown_pasture_land_bp) %>% + Exiobase_TIV_europe_breakdown_energy_use_bp) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year_europe = as.character(rep(year_current,nrow(europe_TIV_with_labels))) @@ -2484,14 +2239,7 @@ for (i in years_exb_ixi){ TIV_SF6_europe = as.numeric(TIV_SF6_europe), TIV_HFC_europe = as.numeric(TIV_HFC_europe), TIV_PFC_europe = as.numeric(TIV_PFC_europe), - TIV_energy_europe = as.numeric(TIV_energy_europe), - TIV_biomass_europe = as.numeric(TIV_biomass_europe), - TIV_const_materials_europe = as.numeric(TIV_const_materials_europe), - TIV_ffuels_europe = as.numeric(TIV_ffuels_europe), - TIV_ores_europe = as.numeric(TIV_ores_europe), - TIV_cropland_europe = as.numeric(TIV_cropland_europe), - TIV_forest_land_europe = as.numeric(TIV_forest_land_europe), - TIV_pasture_land_europe = as.numeric(TIV_pasture_land_europe)) + TIV_energy_europe = as.numeric(TIV_energy_europe)) europe_TIVs = rbind(europe_TIVs, look_europe) @@ -2550,20 +2298,6 @@ for (i in years_exb_ixi){ national_energy_footprints = Exiobase_FD * t(Exiobase_TIV_energy_use_bp) - national_biomass_footprints = Exiobase_FD * t(Exiobase_TIV_biomass_bp) - - national_const_materials_footprints = Exiobase_FD * t(Exiobase_TIV_const_materials_bp) - - national_ffuels_footprints = Exiobase_FD * t(Exiobase_TIV_ffuels_bp) - - national_ores_footprints = Exiobase_FD * t(Exiobase_TIV_ores_bp) - - national_cropland_footprints = Exiobase_FD * t(Exiobase_TIV_cropland_bp) - - national_forest_land_footprints = Exiobase_FD * t(Exiobase_TIV_forest_land_bp) - - national_pasture_land_footprints = Exiobase_FD * t(Exiobase_TIV_pasture_land_bp) - # together @@ -2590,14 +2324,7 @@ for (i in years_exb_ixi){ rowSums(t(national_SF6_footprints)), rowSums(t(national_HFC_footprints)), rowSums(t(national_PFC_footprints)), - rowSums(t(national_energy_footprints)), - rowSums(t(national_biomass_footprints)), - rowSums(t(national_const_materials_footprints)), - rowSums(t(national_ffuels_footprints)), - rowSums(t(national_ores_footprints)), - rowSums(t(national_cropland_footprints)), - rowSums(t(national_forest_land_footprints)), - rowSums(t(national_pasture_land_footprints))) %>% + rowSums(t(national_energy_footprints))) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year_national_fp = as.character(rep(year_current,nrow(national_footprints_w_labels))) @@ -2632,13 +2359,6 @@ for (i in years_exb_ixi){ direct_FD_hfc = direct_FD_extensions[425,] direct_FD_pfc = direct_FD_extensions[426,] direct_FD_energy = direct_FD_extensions[470,] - direct_FD_biomass = colSums(direct_FD_extensions[c(471:499,501,522:688),]) - direct_FD_const_materials = colSums(direct_FD_extensions[514:521,]) - direct_FD_ffuels = direct_FD_extensions[500,] - direct_FD_ores = colSums(direct_FD_extensions[502:513,]) - direct_FD_cropland = colSums(direct_FD_extensions[447:459,]) - direct_FD_forest_land = colSums(direct_FD_extensions[c(460,466),]) - direct_FD_pasture_land = colSums(direct_FD_extensions[462:464,]) direct_FD_fp = data.frame(direct_FD_co2, @@ -2663,14 +2383,7 @@ for (i in years_exb_ixi){ direct_FD_sf6, direct_FD_hfc, direct_FD_pfc, - direct_FD_energy, - direct_FD_biomass, - direct_FD_const_materials, - direct_FD_ffuels, - direct_FD_ores, - direct_FD_cropland, - direct_FD_forest_land, - direct_FD_pasture_land) + direct_FD_energy) look_national_fp = as.data.frame(cbind(year_national_fp, national_footprints_w_labels, @@ -2700,14 +2413,7 @@ for (i in years_exb_ixi){ sf6 = "rowSums(t(national_SF6_footprints))", hfc = "rowSums(t(national_HFC_footprints))", pfc = "rowSums(t(national_PFC_footprints))", - energy = "rowSums(t(national_energy_footprints))", - biomass = "rowSums(t(national_biomass_footprints))", - const_materials = "rowSums(t(national_const_materials_footprints))", - ffuels = "rowSums(t(national_ffuels_footprints))", - ores = "rowSums(t(national_ores_footprints))", - cropland = "rowSums(t(national_cropland_footprints))", - forest_land = "rowSums(t(national_forest_land_footprints))", - pasture_land = "rowSums(t(national_pasture_land_footprints))") %>% + energy = "rowSums(t(national_energy_footprints))") %>% select(year, geo, fd_category, @@ -2756,21 +2462,7 @@ for (i in years_exb_ixi){ pfc, direct_FD_pfc, energy, - direct_FD_energy, - biomass, - direct_FD_biomass, - const_materials, - direct_FD_const_materials, - ffuels, - direct_FD_ffuels, - ores, - direct_FD_ores, - cropland, - direct_FD_cropland, - forest_land, - direct_FD_forest_land, - pasture_land, - direct_FD_pasture_land) + direct_FD_energy) national_fp = rbind(national_fp, look_national_fp) @@ -2842,20 +2534,6 @@ for (i in years_exb_ixi){ energy_carrier_use = satellite[470,] - biomass = as.data.frame(colSums(satellite[c(471:499,501,522:688),])) - - ores = as.data.frame(colSums(satellite[502:513,])) - - const_materials = as.data.frame(colSums(satellite[514:521,])) - - ffuels = satellite[500,] - - cropland = as.data.frame(colSums(satellite[447:459,])) - - pasture_land = as.data.frame(colSums(satellite[462:464,])) - - forest_land = as.data.frame(colSums(satellite[c(460,466),])) - territorial = data.frame(t(CO2_combustion_air), t(CO2_noncombustion_cement_air), @@ -2879,14 +2557,7 @@ for (i in years_exb_ixi){ t(SF6_air), t(HFC_air), t(PFC_air), - t(energy_carrier_use), - biomass, - ores, - const_materials, - t(ffuels), - cropland, - pasture_land, - forest_land) %>% + t(energy_carrier_use)) %>% rename(CO2 = 1, CO2_noncombustion_cement = 2, CO2_noncombustion_lime = 3, @@ -2907,11 +2578,7 @@ for (i in years_exb_ixi){ N2O = 18, N2O_agriculture = 19, SF6 = 20, - HFC = 21, PFC = 22, energy = 23, - biomass = 24, ores = 25, - const_materials = 26, ffuels = 27, - cropland = 28, pasture_land = 29, - forest_land = 30) + HFC = 21, PFC = 22, energy = 23) year_territorial = as.character(rep(year_current,nrow(territorial))) @@ -3092,14 +2759,7 @@ direct_FD_fp_long = national_fp %>% direct_FD_sf6, direct_FD_hfc, direct_FD_pfc, - direct_FD_energy, - direct_FD_biomass, - direct_FD_const_materials, - direct_FD_ffuels, - direct_FD_ores, - direct_FD_cropland, - direct_FD_forest_land, - direct_FD_pasture_land) %>% + direct_FD_energy) %>% slice(rep(1:n(), each = 3)) sector = rep(c("HH_HEAT","HH_TRA","HH_OTH"), nrow(direct_FD_fp_long)/3) @@ -3403,49 +3063,7 @@ results = fd_exiobase %>% q3_energy_europe = QUINTILE3*(TIV_energy_europe - TIV_energy_domestic), q4_energy_europe = QUINTILE4*(TIV_energy_europe - TIV_energy_domestic), q5_energy_europe = QUINTILE5*(TIV_energy_europe - TIV_energy_domestic), - energy_total_europe = q1_energy_europe+q2_energy_europe+q3_energy_europe+q4_energy_europe+q5_energy_europe, - TIV_materials = TIV_biomass+TIV_const_materials+TIV_ffuels+TIV_ores, - q1_materials = QUINTILE1*TIV_materials, - q2_materials = QUINTILE2*TIV_materials, - q3_materials = QUINTILE3*TIV_materials, - q4_materials = QUINTILE4*TIV_materials, - q5_materials = QUINTILE5*TIV_materials, - materials_total = q1_materials+q2_materials+q3_materials+q4_materials+q5_materials, - TIV_materials_domestic = TIV_biomass_domestic+TIV_const_materials_domestic+TIV_ffuels_domestic+TIV_ores_domestic, - q1_materials_domestic = QUINTILE1*TIV_materials_domestic, - q2_materials_domestic = QUINTILE2*TIV_materials_domestic, - q3_materials_domestic = QUINTILE3*TIV_materials_domestic, - q4_materials_domestic = QUINTILE4*TIV_materials_domestic, - q5_materials_domestic = QUINTILE5*TIV_materials_domestic, - materials_total_domestic = q1_materials_domestic+q2_materials_domestic+q3_materials_domestic+q4_materials_domestic+q5_materials_domestic, - TIV_materials_europe = TIV_biomass_europe+TIV_const_materials_europe+TIV_ffuels_europe+TIV_ores_europe, - q1_materials_europe = QUINTILE1*(TIV_materials_europe - TIV_materials_domestic), - q2_materials_europe = QUINTILE2*(TIV_materials_europe - TIV_materials_domestic), - q3_materials_europe = QUINTILE3*(TIV_materials_europe - TIV_materials_domestic), - q4_materials_europe = QUINTILE4*(TIV_materials_europe - TIV_materials_domestic), - q5_materials_europe = QUINTILE5*(TIV_materials_europe - TIV_materials_domestic), - materials_total_europe = q1_materials_europe+q2_materials_europe+q3_materials_europe+q4_materials_europe+q5_materials_europe, - TIV_land_use = TIV_cropland+TIV_forest_land+TIV_pasture_land, - q1_land_use = QUINTILE1*TIV_land_use, - q2_land_use = QUINTILE2*TIV_land_use, - q3_land_use = QUINTILE3*TIV_land_use, - q4_land_use = QUINTILE4*TIV_land_use, - q5_land_use = QUINTILE5*TIV_land_use, - land_use_total =q1_land_use+q2_land_use+q3_land_use+q4_land_use+q5_land_use, - TIV_land_use_domestic = TIV_cropland_domestic+TIV_forest_land_domestic+TIV_pasture_land_domestic, - q1_land_use_domestic = QUINTILE1*TIV_land_use_domestic, - q2_land_use_domestic = QUINTILE2*TIV_land_use_domestic, - q3_land_use_domestic = QUINTILE3*TIV_land_use_domestic, - q4_land_use_domestic = QUINTILE4*TIV_land_use_domestic, - q5_land_use_domestic = QUINTILE5*TIV_land_use_domestic, - land_use_total_domestic =q1_land_use_domestic+q2_land_use_domestic+q3_land_use_domestic+q4_land_use_domestic+q5_land_use_domestic, - TIV_land_use_europe = TIV_cropland_europe+TIV_forest_land_europe+TIV_pasture_land_europe, - q1_land_use_europe = QUINTILE1*(TIV_land_use_europe - TIV_land_use_domestic), - q2_land_use_europe = QUINTILE2*(TIV_land_use_europe - TIV_land_use_domestic), - q3_land_use_europe = QUINTILE3*(TIV_land_use_europe - TIV_land_use_domestic), - q4_land_use_europe = QUINTILE4*(TIV_land_use_europe - TIV_land_use_domestic), - q5_land_use_europe = QUINTILE5*(TIV_land_use_europe - TIV_land_use_domestic), - land_use_total_europe =q1_land_use_europe+q2_land_use_europe+q3_land_use_europe+q4_land_use_europe+q5_land_use_europe) + energy_total_europe = q1_energy_europe+q2_energy_europe+q3_energy_europe+q4_energy_europe+q5_energy_europe) results_with_direct_FD_fp = bind_rows(results,direct_FD_fp_wide) @@ -4430,216 +4048,6 @@ for (i in years_exb_pxp){ ZA) %>% select(TIV_energy_europe,TIV_energy_not_europe) - # biomass - - Exiobase_TIV_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_biomass_",year_current,"_pxp.csv"))[,-1] - - Exiobase_TIV_country_breakdown_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_biomass_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_biomass_domestic) - - Exiobase_TIV_europe_breakdown_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_biomass_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_biomass_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_biomass_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_biomass_europe,TIV_biomass_not_europe) - - # construction materials - - Exiobase_TIV_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_const_materials_",year_current,"_pxp.csv"))[,-1] - - Exiobase_TIV_country_breakdown_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_const_materials_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_const_materials_domestic) - - Exiobase_TIV_europe_breakdown_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_const_materials_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_const_materials_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_const_materials_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_const_materials_europe,TIV_const_materials_not_europe) - - # fossil fuels - - Exiobase_TIV_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_ffuels_",year_current,"_pxp.csv"))[,-1] - - Exiobase_TIV_country_breakdown_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_ffuels_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_ffuels_domestic) - - Exiobase_TIV_europe_breakdown_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_ffuels_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_ffuels_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_ffuels_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_ffuels_europe,TIV_ffuels_not_europe) - - # ores - - Exiobase_TIV_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_ores_",year_current,"_pxp.csv"))[,-1] - - Exiobase_TIV_country_breakdown_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_ores_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_ores_domestic) - - Exiobase_TIV_europe_breakdown_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_ores_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_ores_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_ores_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_ores_europe,TIV_ores_not_europe) - - # cropland - - Exiobase_TIV_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_cropland_",year_current,"_pxp.csv"))[,-1] - - Exiobase_TIV_country_breakdown_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_cropland_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_cropland_domestic) - - Exiobase_TIV_europe_breakdown_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_cropland_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_cropland_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_cropland_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_cropland_europe,TIV_cropland_not_europe) - - # forest land - - Exiobase_TIV_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_forest_land_",year_current,"_pxp.csv"))[,-1] - - Exiobase_TIV_country_breakdown_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_forest_land_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_forest_land_domestic) - - Exiobase_TIV_europe_breakdown_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_forest_land_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_forest_land_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_forest_land_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_forest_land_europe,TIV_forest_land_not_europe) - - # pasture land - - Exiobase_TIV_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_pasture_land_",year_current,"_pxp.csv"))[,-1] - - Exiobase_TIV_country_breakdown_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_pasture_land_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_pasture_land_domestic) - - Exiobase_TIV_europe_breakdown_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_pxp/TIV_country_breakdown_pasture_land_",year_current,"_pxp.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_pasture_land_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_pasture_land_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_pasture_land_europe,TIV_pasture_land_not_europe) - # join with labels @@ -4666,14 +4074,7 @@ for (i in years_exb_pxp){ t(Exiobase_TIV_sf6_bp), t(Exiobase_TIV_hfc_bp), t(Exiobase_TIV_pfc_bp), - t(Exiobase_TIV_energy_use_bp), - t(Exiobase_TIV_biomass_bp), - t(Exiobase_TIV_const_materials_bp), - t(Exiobase_TIV_ffuels_bp), - t(Exiobase_TIV_ores_bp), - t(Exiobase_TIV_cropland_bp), - t(Exiobase_TIV_forest_land_bp), - t(Exiobase_TIV_pasture_land_bp)) %>% + t(Exiobase_TIV_energy_use_bp)) %>% rename(TIV_CO2 = "t(Exiobase_TIV_co2_bp)", TIV_CO2_noncombustion_cement = "t(Exiobase_TIV_co2_noncombustion_cement_bp)", TIV_CO2_noncombustion_lime = "t(Exiobase_TIV_co2_noncombustion_lime_bp)", @@ -4696,14 +4097,7 @@ for (i in years_exb_pxp){ TIV_SF6 = "t(Exiobase_TIV_sf6_bp)", TIV_HFC = "t(Exiobase_TIV_hfc_bp)", TIV_PFC = "t(Exiobase_TIV_pfc_bp)", - TIV_energy = "t(Exiobase_TIV_energy_use_bp)", - TIV_biomass = "t(Exiobase_TIV_biomass_bp)", - TIV_const_materials = "t(Exiobase_TIV_const_materials_bp)", - TIV_ffuels = "t(Exiobase_TIV_ffuels_bp)", - TIV_ores = "t(Exiobase_TIV_ores_bp)", - TIV_cropland = "t(Exiobase_TIV_cropland_bp)", - TIV_forest_land = "t(Exiobase_TIV_forest_land_bp)", - TIV_pasture_land = "t(Exiobase_TIV_pasture_land_bp)") %>% + TIV_energy = "t(Exiobase_TIV_energy_use_bp)") %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year = as.character(rep(year_current,nrow(TIV_with_labels))) @@ -4740,14 +4134,7 @@ for (i in years_exb_pxp){ Exiobase_TIV_country_breakdown_sf6_bp %>% select(-country), Exiobase_TIV_country_breakdown_hfc_bp %>% select(-country), Exiobase_TIV_country_breakdown_pfc_bp %>% select(-country), - Exiobase_TIV_country_breakdown_energy_use_bp %>% select(-country), - Exiobase_TIV_country_breakdown_biomass_bp %>% select(-country), - Exiobase_TIV_country_breakdown_const_materials_bp %>% select(-country), - Exiobase_TIV_country_breakdown_ffuels_bp %>% select(-country), - Exiobase_TIV_country_breakdown_ores_bp %>% select(-country), - Exiobase_TIV_country_breakdown_cropland_bp %>% select(-country), - Exiobase_TIV_country_breakdown_forest_land_bp %>% select(-country), - Exiobase_TIV_country_breakdown_pasture_land_bp %>% select(-country)) %>% + Exiobase_TIV_country_breakdown_energy_use_bp %>% select(-country)) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK"), country = dplyr::recode(country, "GR" = "EL", "GB" = "UK")) @@ -4777,14 +4164,7 @@ for (i in years_exb_pxp){ TIV_SF6_domestic = as.numeric(TIV_SF6_domestic), TIV_HFC_domestic = as.numeric(TIV_HFC_domestic), TIV_PFC_domestic = as.numeric(TIV_PFC_domestic), - TIV_energy_domestic = as.numeric(TIV_energy_domestic), - TIV_biomass_domestic = as.numeric(TIV_biomass_domestic), - TIV_const_materials_domestic = as.numeric(TIV_const_materials_domestic), - TIV_ffuels_domestic = as.numeric(TIV_ffuels_domestic), - TIV_ores_domestic = as.numeric(TIV_ores_domestic), - TIV_cropland_domestic = as.numeric(TIV_cropland_domestic), - TIV_forest_land_domestic = as.numeric(TIV_forest_land_domestic), - TIV_pasture_land_domestic = as.numeric(TIV_pasture_land_domestic)) + TIV_energy_domestic = as.numeric(TIV_energy_domestic)) domestic_TIVs = rbind(domestic_TIVs, look_domestic) @@ -4813,14 +4193,7 @@ for (i in years_exb_pxp){ Exiobase_TIV_europe_breakdown_sf6_bp, Exiobase_TIV_europe_breakdown_hfc_bp, Exiobase_TIV_europe_breakdown_pfc_bp, - Exiobase_TIV_europe_breakdown_energy_use_bp, - Exiobase_TIV_europe_breakdown_biomass_bp, - Exiobase_TIV_europe_breakdown_const_materials_bp, - Exiobase_TIV_europe_breakdown_ffuels_bp, - Exiobase_TIV_europe_breakdown_ores_bp, - Exiobase_TIV_europe_breakdown_cropland_bp, - Exiobase_TIV_europe_breakdown_forest_land_bp, - Exiobase_TIV_europe_breakdown_pasture_land_bp) %>% + Exiobase_TIV_europe_breakdown_energy_use_bp) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year_europe = as.character(rep(year_current,nrow(europe_TIV_with_labels))) @@ -4849,14 +4222,7 @@ for (i in years_exb_pxp){ TIV_SF6_europe = as.numeric(TIV_SF6_europe), TIV_HFC_europe = as.numeric(TIV_HFC_europe), TIV_PFC_europe = as.numeric(TIV_PFC_europe), - TIV_energy_europe = as.numeric(TIV_energy_europe), - TIV_biomass_europe = as.numeric(TIV_biomass_europe), - TIV_const_materials_europe = as.numeric(TIV_const_materials_europe), - TIV_ffuels_europe = as.numeric(TIV_ffuels_europe), - TIV_ores_europe = as.numeric(TIV_ores_europe), - TIV_cropland_europe = as.numeric(TIV_cropland_europe), - TIV_forest_land_europe = as.numeric(TIV_forest_land_europe), - TIV_pasture_land_europe = as.numeric(TIV_pasture_land_europe)) + TIV_energy_europe = as.numeric(TIV_energy_europe)) europe_TIVs = rbind(europe_TIVs, look_europe) @@ -4914,20 +4280,6 @@ for (i in years_exb_pxp){ national_energy_footprints = Exiobase_FD * t(Exiobase_TIV_energy_use_bp) - national_biomass_footprints = Exiobase_FD * t(Exiobase_TIV_biomass_bp) - - national_const_materials_footprints = Exiobase_FD * t(Exiobase_TIV_const_materials_bp) - - national_ffuels_footprints = Exiobase_FD * t(Exiobase_TIV_ffuels_bp) - - national_ores_footprints = Exiobase_FD * t(Exiobase_TIV_ores_bp) - - national_cropland_footprints = Exiobase_FD * t(Exiobase_TIV_cropland_bp) - - national_forest_land_footprints = Exiobase_FD * t(Exiobase_TIV_forest_land_bp) - - national_pasture_land_footprints = Exiobase_FD * t(Exiobase_TIV_pasture_land_bp) - # together @@ -4954,14 +4306,7 @@ for (i in years_exb_pxp){ rowSums(t(national_SF6_footprints)), rowSums(t(national_HFC_footprints)), rowSums(t(national_PFC_footprints)), - rowSums(t(national_energy_footprints)), - rowSums(t(national_biomass_footprints)), - rowSums(t(national_const_materials_footprints)), - rowSums(t(national_ffuels_footprints)), - rowSums(t(national_ores_footprints)), - rowSums(t(national_cropland_footprints)), - rowSums(t(national_forest_land_footprints)), - rowSums(t(national_pasture_land_footprints))) %>% + rowSums(t(national_energy_footprints))) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year_national_fp = as.character(rep(year_current,nrow(national_footprints_w_labels))) @@ -4997,13 +4342,6 @@ for (i in years_exb_pxp){ direct_FD_hfc = direct_FD_extensions[425,] direct_FD_pfc = direct_FD_extensions[426,] direct_FD_energy = direct_FD_extensions[470,] - direct_FD_biomass = colSums(direct_FD_extensions[c(471:499,501,522:688),]) - direct_FD_const_materials = colSums(direct_FD_extensions[514:521,]) - direct_FD_ffuels = direct_FD_extensions[500,] - direct_FD_ores = colSums(direct_FD_extensions[502:513,]) - direct_FD_cropland = colSums(direct_FD_extensions[447:459,]) - direct_FD_forest_land = colSums(direct_FD_extensions[c(460,466),]) - direct_FD_pasture_land = colSums(direct_FD_extensions[462:464,]) direct_FD_fp = data.frame(direct_FD_co2, @@ -5028,14 +4366,7 @@ for (i in years_exb_pxp){ direct_FD_sf6, direct_FD_hfc, direct_FD_pfc, - direct_FD_energy, - direct_FD_biomass, - direct_FD_const_materials, - direct_FD_ffuels, - direct_FD_ores, - direct_FD_cropland, - direct_FD_forest_land, - direct_FD_pasture_land) + direct_FD_energy) look_national_fp = as.data.frame(cbind(year_national_fp, national_footprints_w_labels, @@ -5065,14 +4396,7 @@ for (i in years_exb_pxp){ sf6 = "rowSums(t(national_SF6_footprints))", hfc = "rowSums(t(national_HFC_footprints))", pfc = "rowSums(t(national_PFC_footprints))", - energy = "rowSums(t(national_energy_footprints))", - biomass = "rowSums(t(national_biomass_footprints))", - const_materials = "rowSums(t(national_const_materials_footprints))", - ffuels = "rowSums(t(national_ffuels_footprints))", - ores = "rowSums(t(national_ores_footprints))", - cropland = "rowSums(t(national_cropland_footprints))", - forest_land = "rowSums(t(national_forest_land_footprints))", - pasture_land = "rowSums(t(national_pasture_land_footprints))") %>% + energy = "rowSums(t(national_energy_footprints))") %>% select(year, geo, fd_category, @@ -5121,21 +4445,7 @@ for (i in years_exb_pxp){ pfc, direct_FD_pfc, energy, - direct_FD_energy, - biomass, - direct_FD_biomass, - const_materials, - direct_FD_const_materials, - ffuels, - direct_FD_ffuels, - ores, - direct_FD_ores, - cropland, - direct_FD_cropland, - forest_land, - direct_FD_forest_land, - pasture_land, - direct_FD_pasture_land) + direct_FD_energy) national_fp = rbind(national_fp, look_national_fp) @@ -5205,20 +4515,6 @@ for (i in years_exb_pxp){ energy_carrier_use = satellite[470,] - biomass = as.data.frame(colSums(satellite[c(471:499,501,522:688),])) - - ores = as.data.frame(colSums(satellite[502:513,])) - - const_materials = as.data.frame(colSums(satellite[514:521,])) - - ffuels = satellite[500,] - - cropland = as.data.frame(colSums(satellite[447:459,])) - - pasture_land = as.data.frame(colSums(satellite[462:464,])) - - forest_land = as.data.frame(colSums(satellite[c(460,466),])) - territorial = data.frame(t(CO2_combustion_air), t(CO2_noncombustion_cement_air), @@ -5242,14 +4538,7 @@ for (i in years_exb_pxp){ t(SF6_air), t(HFC_air), t(PFC_air), - t(energy_carrier_use), - biomass, - ores, - const_materials, - t(ffuels), - cropland, - pasture_land, - forest_land) %>% + t(energy_carrier_use)) %>% rename(CO2 = 1, CO2_noncombustion_cement = 2, CO2_noncombustion_lime = 3, @@ -5270,11 +4559,7 @@ for (i in years_exb_pxp){ N2O = 18, N2O_agriculture = 19, SF6 = 20, - HFC = 21, PFC = 22, energy = 23, - biomass = 24, ores = 25, - const_materials = 26, ffuels = 27, - cropland = 28, pasture_land = 29, - forest_land = 30) + HFC = 21, PFC = 22, energy = 23) year_territorial = as.character(rep(year_current,nrow(territorial))) @@ -5456,14 +4741,7 @@ direct_FD_fp_long = national_fp %>% direct_FD_sf6, direct_FD_hfc, direct_FD_pfc, - direct_FD_energy, - direct_FD_biomass, - direct_FD_const_materials, - direct_FD_ffuels, - direct_FD_ores, - direct_FD_cropland, - direct_FD_forest_land, - direct_FD_pasture_land) %>% + direct_FD_energy) %>% slice(rep(1:n(), each = 3)) sector = rep(c("HH_HEAT","HH_TRA","HH_OTH"), nrow(direct_FD_fp_long)/3) @@ -5767,49 +5045,7 @@ results = fd_exiobase %>% q3_energy_europe = QUINTILE3*(TIV_energy_europe - TIV_energy_domestic), q4_energy_europe = QUINTILE4*(TIV_energy_europe - TIV_energy_domestic), q5_energy_europe = QUINTILE5*(TIV_energy_europe - TIV_energy_domestic), - energy_total_europe = q1_energy_europe+q2_energy_europe+q3_energy_europe+q4_energy_europe+q5_energy_europe, - TIV_materials = TIV_biomass+TIV_const_materials+TIV_ffuels+TIV_ores, - q1_materials = QUINTILE1*TIV_materials, - q2_materials = QUINTILE2*TIV_materials, - q3_materials = QUINTILE3*TIV_materials, - q4_materials = QUINTILE4*TIV_materials, - q5_materials = QUINTILE5*TIV_materials, - materials_total = q1_materials+q2_materials+q3_materials+q4_materials+q5_materials, - TIV_materials_domestic = TIV_biomass_domestic+TIV_const_materials_domestic+TIV_ffuels_domestic+TIV_ores_domestic, - q1_materials_domestic = QUINTILE1*TIV_materials_domestic, - q2_materials_domestic = QUINTILE2*TIV_materials_domestic, - q3_materials_domestic = QUINTILE3*TIV_materials_domestic, - q4_materials_domestic = QUINTILE4*TIV_materials_domestic, - q5_materials_domestic = QUINTILE5*TIV_materials_domestic, - materials_total_domestic = q1_materials_domestic+q2_materials_domestic+q3_materials_domestic+q4_materials_domestic+q5_materials_domestic, - TIV_materials_europe = TIV_biomass_europe+TIV_const_materials_europe+TIV_ffuels_europe+TIV_ores_europe, - q1_materials_europe = QUINTILE1*(TIV_materials_europe - TIV_materials_domestic), - q2_materials_europe = QUINTILE2*(TIV_materials_europe - TIV_materials_domestic), - q3_materials_europe = QUINTILE3*(TIV_materials_europe - TIV_materials_domestic), - q4_materials_europe = QUINTILE4*(TIV_materials_europe - TIV_materials_domestic), - q5_materials_europe = QUINTILE5*(TIV_materials_europe - TIV_materials_domestic), - materials_total_europe = q1_materials_europe+q2_materials_europe+q3_materials_europe+q4_materials_europe+q5_materials_europe, - TIV_land_use = TIV_cropland+TIV_forest_land+TIV_pasture_land, - q1_land_use = QUINTILE1*TIV_land_use, - q2_land_use = QUINTILE2*TIV_land_use, - q3_land_use = QUINTILE3*TIV_land_use, - q4_land_use = QUINTILE4*TIV_land_use, - q5_land_use = QUINTILE5*TIV_land_use, - land_use_total =q1_land_use+q2_land_use+q3_land_use+q4_land_use+q5_land_use, - TIV_land_use_domestic = TIV_cropland_domestic+TIV_forest_land_domestic+TIV_pasture_land_domestic, - q1_land_use_domestic = QUINTILE1*TIV_land_use_domestic, - q2_land_use_domestic = QUINTILE2*TIV_land_use_domestic, - q3_land_use_domestic = QUINTILE3*TIV_land_use_domestic, - q4_land_use_domestic = QUINTILE4*TIV_land_use_domestic, - q5_land_use_domestic = QUINTILE5*TIV_land_use_domestic, - land_use_total_domestic =q1_land_use_domestic+q2_land_use_domestic+q3_land_use_domestic+q4_land_use_domestic+q5_land_use_domestic, - TIV_land_use_europe = TIV_cropland_europe+TIV_forest_land_europe+TIV_pasture_land_europe, - q1_land_use_europe = QUINTILE1*(TIV_land_use_europe - TIV_land_use_domestic), - q2_land_use_europe = QUINTILE2*(TIV_land_use_europe - TIV_land_use_domestic), - q3_land_use_europe = QUINTILE3*(TIV_land_use_europe - TIV_land_use_domestic), - q4_land_use_europe = QUINTILE4*(TIV_land_use_europe - TIV_land_use_domestic), - q5_land_use_europe = QUINTILE5*(TIV_land_use_europe - TIV_land_use_domestic), - land_use_total_europe =q1_land_use_europe+q2_land_use_europe+q3_land_use_europe+q4_land_use_europe+q5_land_use_europe) + energy_total_europe = q1_energy_europe+q2_energy_europe+q3_energy_europe+q4_energy_europe+q5_energy_europe) results_with_direct_FD_fp = bind_rows(results,direct_FD_fp_wide) #write.csv(results, paste0(data_dir_income_stratified_footprints, "/results_no_rent_ixi.csv")) @@ -7116,217 +6352,6 @@ for (i in years_exb_ixi){ ZA) %>% select(TIV_energy_europe,TIV_energy_not_europe) - # biomass - - Exiobase_TIV_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_biomass_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_biomass_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_biomass_domestic) - - Exiobase_TIV_europe_breakdown_biomass_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_biomass_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_biomass_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_biomass_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_biomass_europe,TIV_biomass_not_europe) - - # construction materials - - Exiobase_TIV_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_const_materials_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_const_materials_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_const_materials_domestic) - - Exiobase_TIV_europe_breakdown_const_materials_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_const_materials_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_const_materials_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_const_materials_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_const_materials_europe,TIV_const_materials_not_europe) - - # fossil fuels - - Exiobase_TIV_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_ffuels_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_ffuels_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_ffuels_domestic) - - Exiobase_TIV_europe_breakdown_ffuels_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_ffuels_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_ffuels_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_ffuels_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_ffuels_europe,TIV_ffuels_not_europe) - - # ores - - Exiobase_TIV_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_ores_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_ores_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_ores_domestic) - - Exiobase_TIV_europe_breakdown_ores_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_ores_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_ores_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_ores_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_ores_europe,TIV_ores_not_europe) - - # cropland - - Exiobase_TIV_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_cropland_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_cropland_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_cropland_domestic) - - Exiobase_TIV_europe_breakdown_cropland_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_cropland_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_cropland_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_cropland_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_cropland_europe,TIV_cropland_not_europe) - - # forest land - - Exiobase_TIV_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_forest_land_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_forest_land_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_forest_land_domestic) - - Exiobase_TIV_europe_breakdown_forest_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_forest_land_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_forest_land_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_forest_land_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_forest_land_europe,TIV_forest_land_not_europe) - - # pasture land - - Exiobase_TIV_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_pasture_land_",year_current,"_ixi.csv"))[,-1] - - Exiobase_TIV_country_breakdown_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_pasture_land_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - gather(country, TIV_pasture_land_domestic) - - Exiobase_TIV_europe_breakdown_pasture_land_bp = read.csv(paste0(data_dir_exiobase, "/IOT_",year_current,"_ixi/TIV_country_breakdown_pasture_land_",year_current,"_ixi.csv"))[,-1] %>% - row_to_names(row_number = 1) %>% - mutate_at(vars(AT:ZA), funs(as.numeric(as.character(.)))) %>% - mutate(TIV_pasture_land_europe = AT + - BE + BG + CY + CZ + - DE + DK + EE + - ES + FI + FR + - GB + GR + HR + - HU + IE + IT + - LT + LU + LV + - MT + NL + PL + - PT + TR + SK + - SI + SE + RO + - NO, - TIV_pasture_land_not_europe = AU + - BR + CA + CH + CN + - ID + IN + JP + KR + - MX + RU + TW + US + - WA + WE + WF + WL + WM + - ZA) %>% - select(TIV_pasture_land_europe,TIV_pasture_land_not_europe) - - # join with labels TIV_with_labels = cbind(Exiobase_T_labels, @@ -7352,14 +6377,7 @@ for (i in years_exb_ixi){ t(Exiobase_TIV_sf6_bp), t(Exiobase_TIV_hfc_bp), t(Exiobase_TIV_pfc_bp), - t(Exiobase_TIV_energy_use_bp), - t(Exiobase_TIV_biomass_bp), - t(Exiobase_TIV_const_materials_bp), - t(Exiobase_TIV_ffuels_bp), - t(Exiobase_TIV_ores_bp), - t(Exiobase_TIV_cropland_bp), - t(Exiobase_TIV_forest_land_bp), - t(Exiobase_TIV_pasture_land_bp)) %>% + t(Exiobase_TIV_energy_use_bp)) %>% rename(TIV_CO2 = "t(Exiobase_TIV_co2_bp)", TIV_CO2_noncombustion_cement = "t(Exiobase_TIV_co2_noncombustion_cement_bp)", TIV_CO2_noncombustion_lime = "t(Exiobase_TIV_co2_noncombustion_lime_bp)", @@ -7382,14 +6400,7 @@ for (i in years_exb_ixi){ TIV_SF6 = "t(Exiobase_TIV_sf6_bp)", TIV_HFC = "t(Exiobase_TIV_hfc_bp)", TIV_PFC = "t(Exiobase_TIV_pfc_bp)", - TIV_energy = "t(Exiobase_TIV_energy_use_bp)", - TIV_biomass = "t(Exiobase_TIV_biomass_bp)", - TIV_const_materials = "t(Exiobase_TIV_const_materials_bp)", - TIV_ffuels = "t(Exiobase_TIV_ffuels_bp)", - TIV_ores = "t(Exiobase_TIV_ores_bp)", - TIV_cropland = "t(Exiobase_TIV_cropland_bp)", - TIV_forest_land = "t(Exiobase_TIV_forest_land_bp)", - TIV_pasture_land = "t(Exiobase_TIV_pasture_land_bp)") %>% + TIV_energy = "t(Exiobase_TIV_energy_use_bp)") %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year = as.character(rep(year_current,nrow(TIV_with_labels))) @@ -7424,14 +6435,7 @@ for (i in years_exb_ixi){ Exiobase_TIV_country_breakdown_sf6_bp %>% select(-country), Exiobase_TIV_country_breakdown_hfc_bp %>% select(-country), Exiobase_TIV_country_breakdown_pfc_bp %>% select(-country), - Exiobase_TIV_country_breakdown_energy_use_bp %>% select(-country), - Exiobase_TIV_country_breakdown_biomass_bp %>% select(-country), - Exiobase_TIV_country_breakdown_const_materials_bp %>% select(-country), - Exiobase_TIV_country_breakdown_ffuels_bp %>% select(-country), - Exiobase_TIV_country_breakdown_ores_bp %>% select(-country), - Exiobase_TIV_country_breakdown_cropland_bp %>% select(-country), - Exiobase_TIV_country_breakdown_forest_land_bp %>% select(-country), - Exiobase_TIV_country_breakdown_pasture_land_bp %>% select(-country)) %>% + Exiobase_TIV_country_breakdown_energy_use_bp %>% select(-country)) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK"), country = dplyr::recode(country, "GR" = "EL", "GB" = "UK")) @@ -7461,14 +6465,7 @@ for (i in years_exb_ixi){ TIV_SF6_domestic = as.numeric(TIV_SF6_domestic), TIV_HFC_domestic = as.numeric(TIV_HFC_domestic), TIV_PFC_domestic = as.numeric(TIV_PFC_domestic), - TIV_energy_domestic = as.numeric(TIV_energy_domestic), - TIV_biomass_domestic = as.numeric(TIV_biomass_domestic), - TIV_const_materials_domestic = as.numeric(TIV_const_materials_domestic), - TIV_ffuels_domestic = as.numeric(TIV_ffuels_domestic), - TIV_ores_domestic = as.numeric(TIV_ores_domestic), - TIV_cropland_domestic = as.numeric(TIV_cropland_domestic), - TIV_forest_land_domestic = as.numeric(TIV_forest_land_domestic), - TIV_pasture_land_domestic = as.numeric(TIV_pasture_land_domestic)) + TIV_energy_domestic = as.numeric(TIV_energy_domestic)) domestic_TIVs = rbind(domestic_TIVs, look_domestic) @@ -7497,14 +6494,7 @@ for (i in years_exb_ixi){ Exiobase_TIV_europe_breakdown_sf6_bp, Exiobase_TIV_europe_breakdown_hfc_bp, Exiobase_TIV_europe_breakdown_pfc_bp, - Exiobase_TIV_europe_breakdown_energy_use_bp, - Exiobase_TIV_europe_breakdown_biomass_bp, - Exiobase_TIV_europe_breakdown_const_materials_bp, - Exiobase_TIV_europe_breakdown_ffuels_bp, - Exiobase_TIV_europe_breakdown_ores_bp, - Exiobase_TIV_europe_breakdown_cropland_bp, - Exiobase_TIV_europe_breakdown_forest_land_bp, - Exiobase_TIV_europe_breakdown_pasture_land_bp) %>% + Exiobase_TIV_europe_breakdown_energy_use_bp) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year_europe = as.character(rep(year_current,nrow(europe_TIV_with_labels))) @@ -7533,14 +6523,7 @@ for (i in years_exb_ixi){ TIV_SF6_europe = as.numeric(TIV_SF6_europe), TIV_HFC_europe = as.numeric(TIV_HFC_europe), TIV_PFC_europe = as.numeric(TIV_PFC_europe), - TIV_energy_europe = as.numeric(TIV_energy_europe), - TIV_biomass_europe = as.numeric(TIV_biomass_europe), - TIV_const_materials_europe = as.numeric(TIV_const_materials_europe), - TIV_ffuels_europe = as.numeric(TIV_ffuels_europe), - TIV_ores_europe = as.numeric(TIV_ores_europe), - TIV_cropland_europe = as.numeric(TIV_cropland_europe), - TIV_forest_land_europe = as.numeric(TIV_forest_land_europe), - TIV_pasture_land_europe = as.numeric(TIV_pasture_land_europe)) + TIV_energy_europe = as.numeric(TIV_energy_europe)) europe_TIVs = rbind(europe_TIVs, look_europe) @@ -7597,20 +6580,6 @@ for (i in years_exb_ixi){ national_energy_footprints = Exiobase_FD * t(Exiobase_TIV_energy_use_bp) - national_biomass_footprints = Exiobase_FD * t(Exiobase_TIV_biomass_bp) - - national_const_materials_footprints = Exiobase_FD * t(Exiobase_TIV_const_materials_bp) - - national_ffuels_footprints = Exiobase_FD * t(Exiobase_TIV_ffuels_bp) - - national_ores_footprints = Exiobase_FD * t(Exiobase_TIV_ores_bp) - - national_cropland_footprints = Exiobase_FD * t(Exiobase_TIV_cropland_bp) - - national_forest_land_footprints = Exiobase_FD * t(Exiobase_TIV_forest_land_bp) - - national_pasture_land_footprints = Exiobase_FD * t(Exiobase_TIV_pasture_land_bp) - # together @@ -7637,14 +6606,7 @@ for (i in years_exb_ixi){ rowSums(t(national_SF6_footprints)), rowSums(t(national_HFC_footprints)), rowSums(t(national_PFC_footprints)), - rowSums(t(national_energy_footprints)), - rowSums(t(national_biomass_footprints)), - rowSums(t(national_const_materials_footprints)), - rowSums(t(national_ffuels_footprints)), - rowSums(t(national_ores_footprints)), - rowSums(t(national_cropland_footprints)), - rowSums(t(national_forest_land_footprints)), - rowSums(t(national_pasture_land_footprints))) %>% + rowSums(t(national_energy_footprints))) %>% mutate(V1 = dplyr::recode(V1,"GR" = "EL","GB" = "UK")) year_national_fp = as.character(rep(year_current,nrow(national_footprints_w_labels))) @@ -7679,13 +6641,6 @@ for (i in years_exb_ixi){ direct_FD_hfc = direct_FD_extensions[425,] direct_FD_pfc = direct_FD_extensions[426,] direct_FD_energy = direct_FD_extensions[470,] - direct_FD_biomass = colSums(direct_FD_extensions[c(471:499,501,522:688),]) - direct_FD_const_materials = colSums(direct_FD_extensions[514:521,]) - direct_FD_ffuels = direct_FD_extensions[500,] - direct_FD_ores = colSums(direct_FD_extensions[502:513,]) - direct_FD_cropland = colSums(direct_FD_extensions[447:459,]) - direct_FD_forest_land = colSums(direct_FD_extensions[c(460,466),]) - direct_FD_pasture_land = colSums(direct_FD_extensions[462:464,]) direct_FD_fp = data.frame(direct_FD_co2, @@ -7710,14 +6665,7 @@ for (i in years_exb_ixi){ direct_FD_sf6, direct_FD_hfc, direct_FD_pfc, - direct_FD_energy, - direct_FD_biomass, - direct_FD_const_materials, - direct_FD_ffuels, - direct_FD_ores, - direct_FD_cropland, - direct_FD_forest_land, - direct_FD_pasture_land) + direct_FD_energy) look_national_fp = as.data.frame(cbind(year_national_fp, national_footprints_w_labels, @@ -7747,14 +6695,7 @@ for (i in years_exb_ixi){ sf6 = "rowSums(t(national_SF6_footprints))", hfc = "rowSums(t(national_HFC_footprints))", pfc = "rowSums(t(national_PFC_footprints))", - energy = "rowSums(t(national_energy_footprints))", - biomass = "rowSums(t(national_biomass_footprints))", - const_materials = "rowSums(t(national_const_materials_footprints))", - ffuels = "rowSums(t(national_ffuels_footprints))", - ores = "rowSums(t(national_ores_footprints))", - cropland = "rowSums(t(national_cropland_footprints))", - forest_land = "rowSums(t(national_forest_land_footprints))", - pasture_land = "rowSums(t(national_pasture_land_footprints))") %>% + energy = "rowSums(t(national_energy_footprints))") %>% select(year, geo, fd_category, @@ -7803,21 +6744,7 @@ for (i in years_exb_ixi){ pfc, direct_FD_pfc, energy, - direct_FD_energy, - biomass, - direct_FD_biomass, - const_materials, - direct_FD_const_materials, - ffuels, - direct_FD_ffuels, - ores, - direct_FD_ores, - cropland, - direct_FD_cropland, - forest_land, - direct_FD_forest_land, - pasture_land, - direct_FD_pasture_land) + direct_FD_energy) national_fp = rbind(national_fp, look_national_fp) @@ -7877,8 +6804,7 @@ weighted_mean_TIV_with_labels = cbind(TIVs,Eurostat_countries_hh_fd_mean_TIV) %> -TIV_CH4_noncombustion_subbituminouscoal,-TIV_CH4_noncombustion_oilrefinery, -TIV_CH4_agriculture,-TIV_CH4_waste, -TIV_N2O,-TIV_N2O_agriculture,-TIV_SF6,-TIV_HFC,-TIV_PFC, - -TIV_energy,-TIV_biomass,-TIV_const_materials,-TIV_ffuels, - -TIV_ores,-TIV_cropland,-TIV_forest_land,-TIV_pasture_land) %>% + -TIV_energy) %>% group_by(geo,year,coicop) %>% mutate(fd = as.numeric(fd)) %>% mutate(TIV_CO2_weighted_average = sum((fd/sum(fd))*TIV_CO2), @@ -7903,14 +6829,7 @@ weighted_mean_TIV_with_labels = cbind(TIVs,Eurostat_countries_hh_fd_mean_TIV) %> TIV_SF6_weighted_average = sum((fd/sum(fd))*TIV_SF6), TIV_HFC_weighted_average = sum((fd/sum(fd))*TIV_HFC), TIV_PFC_weighted_average = sum((fd/sum(fd))*TIV_PFC), - TIV_energy_weighted_average = sum((fd/sum(fd))*TIV_energy), - TIV_biomass_weighted_average = sum((fd/sum(fd))*TIV_biomass), - TIV_const_materials_weighted_average = sum((fd/sum(fd))*TIV_const_materials), - TIV_ffuels_weighted_average = sum((fd/sum(fd))*TIV_ffuels), - TIV_ores_weighted_average = sum((fd/sum(fd))*TIV_ores), - TIV_cropland_weighted_average = sum((fd/sum(fd))*TIV_cropland), - TIV_forest_land_weighted_average = sum((fd/sum(fd))*TIV_forest_land), - TIV_pasture_land_weighted_average = sum((fd/sum(fd))*TIV_pasture_land)) %>% + TIV_energy_weighted_average = sum((fd/sum(fd))*TIV_energy)) %>% select(year,geo,coicop,TIV_CO2_weighted_average, TIV_CO2_noncombustion_cement_weighted_average, TIV_CO2_noncombustion_lime_weighted_average, @@ -7933,14 +6852,7 @@ weighted_mean_TIV_with_labels = cbind(TIVs,Eurostat_countries_hh_fd_mean_TIV) %> TIV_SF6_weighted_average, TIV_HFC_weighted_average, TIV_PFC_weighted_average, - TIV_energy_weighted_average, - TIV_biomass_weighted_average, - TIV_const_materials_weighted_average, - TIV_ffuels_weighted_average, - TIV_ores_weighted_average, - TIV_cropland_weighted_average, - TIV_forest_land_weighted_average, - TIV_pasture_land_weighted_average) %>% + TIV_energy_weighted_average) %>% unique() weighted_mean_europe_TIV_with_labels = cbind(europe_TIVs, Eurostat_countries_hh_fd_mean_TIV) %>% @@ -7966,10 +6878,7 @@ weighted_mean_europe_TIV_with_labels = cbind(europe_TIVs, Eurostat_countries_hh_ -TIV_N2O_agriculture_europe,-TIV_N2O_agriculture_not_europe, -TIV_SF6_europe,-TIV_SF6_not_europe, -TIV_HFC_europe,-TIV_HFC_not_europe,-TIV_PFC_europe,-TIV_PFC_not_europe, - -TIV_energy_europe,-TIV_energy_not_europe,-TIV_biomass_europe,-TIV_biomass_not_europe, - -TIV_const_materials_europe,-TIV_const_materials_not_europe,-TIV_ffuels_europe,-TIV_ffuels_not_europe, - -TIV_ores_europe,-TIV_ores_not_europe,-TIV_cropland_europe,-TIV_cropland_not_europe, - -TIV_forest_land_europe,-TIV_forest_land_not_europe,-TIV_pasture_land_europe,-TIV_pasture_land_not_europe) %>% + -TIV_energy_europe,-TIV_energy_not_europe) %>% group_by(geo,year,coicop) %>% mutate(fd = as.numeric(fd)) %>% mutate(TIV_CO2_europe_weighted_average = sum((fd/sum(fd))*TIV_CO2_europe), @@ -7994,14 +6903,7 @@ weighted_mean_europe_TIV_with_labels = cbind(europe_TIVs, Eurostat_countries_hh_ TIV_SF6_europe_weighted_average = sum((fd/sum(fd))*TIV_SF6_europe), TIV_HFC_europe_weighted_average = sum((fd/sum(fd))*TIV_HFC_europe), TIV_PFC_europe_weighted_average = sum((fd/sum(fd))*TIV_PFC_europe), - TIV_energy_europe_weighted_average = sum((fd/sum(fd))*TIV_energy_europe), - TIV_biomass_europe_weighted_average = sum((fd/sum(fd))*TIV_biomass_europe), - TIV_const_materials_europe_weighted_average = sum((fd/sum(fd))*TIV_const_materials_europe), - TIV_ffuels_europe_weighted_average = sum((fd/sum(fd))*TIV_ffuels_europe), - TIV_ores_europe_weighted_average = sum((fd/sum(fd))*TIV_ores_europe), - TIV_cropland_europe_weighted_average = sum((fd/sum(fd))*TIV_cropland_europe), - TIV_forest_land_europe_weighted_average = sum((fd/sum(fd))*TIV_forest_land_europe), - TIV_pasture_land_europe_weighted_average = sum((fd/sum(fd))*TIV_pasture_land_europe)) %>% + TIV_energy_europe_weighted_average = sum((fd/sum(fd))*TIV_energy_europe)) %>% select(year,geo,coicop,TIV_CO2_europe_weighted_average, TIV_CO2_noncombustion_cement_europe_weighted_average, TIV_CO2_noncombustion_lime_europe_weighted_average, @@ -8024,14 +6926,7 @@ weighted_mean_europe_TIV_with_labels = cbind(europe_TIVs, Eurostat_countries_hh_ TIV_SF6_europe_weighted_average, TIV_HFC_europe_weighted_average, TIV_PFC_europe_weighted_average, - TIV_energy_europe_weighted_average, - TIV_biomass_europe_weighted_average, - TIV_const_materials_europe_weighted_average, - TIV_ffuels_europe_weighted_average, - TIV_ores_europe_weighted_average, - TIV_cropland_europe_weighted_average, - TIV_forest_land_europe_weighted_average, - TIV_pasture_land_europe_weighted_average) %>% + TIV_energy_europe_weighted_average) %>% unique() domestic_TIVs_Eurostat = domestic_TIVs %>% @@ -8124,14 +7019,7 @@ weighted_mean_domestic_TIV_with_labels = cbind(domestic_TIVs_Eurostat,Eurostat_c TIV_SF6_domestic_weighted_average = sum((fd/sum(fd))*TIV_SF6_domestic), TIV_HFC_domestic_weighted_average = sum((fd/sum(fd))*TIV_HFC_domestic), TIV_PFC_domestic_weighted_average = sum((fd/sum(fd))*TIV_PFC_domestic), - TIV_energy_domestic_weighted_average = sum((fd/sum(fd))*TIV_energy_domestic), - TIV_biomass_domestic_weighted_average = sum((fd/sum(fd))*TIV_biomass_domestic), - TIV_const_materials_domestic_weighted_average = sum((fd/sum(fd))*TIV_const_materials_domestic), - TIV_ffuels_domestic_weighted_average = sum((fd/sum(fd))*TIV_ffuels_domestic), - TIV_ores_domestic_weighted_average = sum((fd/sum(fd))*TIV_ores_domestic), - TIV_cropland_domestic_weighted_average = sum((fd/sum(fd))*TIV_cropland_domestic), - TIV_forest_land_domestic_weighted_average = sum((fd/sum(fd))*TIV_forest_land_domestic), - TIV_pasture_land_domestic_weighted_average = sum((fd/sum(fd))*TIV_pasture_land_domestic)) %>% + TIV_energy_domestic_weighted_average = sum((fd/sum(fd))*TIV_energy_domestic)) %>% select(year,geo,coicop,TIV_CO2_domestic_weighted_average, TIV_CO2_noncombustion_cement_domestic_weighted_average, TIV_CO2_noncombustion_lime_domestic_weighted_average, @@ -8154,14 +7042,7 @@ weighted_mean_domestic_TIV_with_labels = cbind(domestic_TIVs_Eurostat,Eurostat_c TIV_SF6_domestic_weighted_average, TIV_HFC_domestic_weighted_average, TIV_PFC_domestic_weighted_average, - TIV_energy_domestic_weighted_average, - TIV_biomass_domestic_weighted_average, - TIV_const_materials_domestic_weighted_average, - TIV_ffuels_domestic_weighted_average, - TIV_ores_domestic_weighted_average, - TIV_cropland_domestic_weighted_average, - TIV_forest_land_domestic_weighted_average, - TIV_pasture_land_domestic_weighted_average) %>% + TIV_energy_domestic_weighted_average) %>% unique() @@ -8414,14 +7295,7 @@ direct_FD_fp_long = national_fp %>% direct_FD_sf6, direct_FD_hfc, direct_FD_pfc, - direct_FD_energy, - direct_FD_biomass, - direct_FD_const_materials, - direct_FD_ffuels, - direct_FD_ores, - direct_FD_cropland, - direct_FD_forest_land, - direct_FD_pasture_land) %>% + direct_FD_energy) %>% slice(rep(1:n(), each = 3)) sector = rep(c("HH_HEAT","HH_TRA","HH_OTH"), nrow(direct_FD_fp_long)/3)