Title: | What the Package Does (Title Case) |
---|---|
Description: | More about what it does (maybe more than one line) Use four spaces when indenting paragraphs within the Description. |
Authors: | Who wrote it |
Maintainer: | The package maintainer <[email protected]> |
License: | What license is it under? |
Version: | 0.1.0 |
Built: | 2024-11-20 05:21:39 UTC |
Source: | https://github.com/InseeFrLab/Avionic24 |
AddRownamesToFirstCol Add Rownames To First Column
AddRownamesToFirstCol(df)
AddRownamesToFirstCol(df)
df |
dataframe |
df data frame
Agreg_Manuf greggation function TypAgreg= Manuf_CT ; Manuf_IP19 ; Manuf_CT_lrwiod ; Manuf_IP19_lrwiod MRIO= LRWIOD ; WIOD; FIGARO Warning : the variable to agreggate must be named "value" Use of StructDocs to manage classifications
Agreg_Manuf(DT, MRIO, Var_To_Agreg, TypAgreg)
Agreg_Manuf(DT, MRIO, Var_To_Agreg, TypAgreg)
DT |
datatable |
MRIO |
MRIO object |
Var_To_Agreg |
text variable |
TypAgreg |
text |
dl data long
AjoutPRBR Add PR and BR to help transposing tables to wide format (eg. matrix like A or L)
AjoutPRBR(dl)
AjoutPRBR(dl)
dl |
long data |
dl data long
## Not run: f_dt <- AjoutPRBR(interm) y_dt <- AjoutPRBR(y_dt) ## End(Not run)
## Not run: f_dt <- AjoutPRBR(interm) y_dt <- AjoutPRBR(y_dt) ## End(Not run)
Attr_TxSimu_HRM_100MoE Function to affect the right Why 100Mo ? / because as we exchange imports with production we need to have enough imports. –> Linear Model => results*10 with no problem. TypeTx = "VA" or "PROD"
Attr_TxSimu_HRM_100MoE( Produit, pays, annee, TypeTx = "VA", OptSourceRDS = "XXXXX", OptMRIOlong = NULL )
Attr_TxSimu_HRM_100MoE( Produit, pays, annee, TypeTx = "VA", OptSourceRDS = "XXXXX", OptMRIOlong = NULL )
Produit |
text industry |
pays |
text country |
annee |
year |
TypeTx |
text |
OptSourceRDS |
binary |
OptMRIOlong |
binary |
numeric value
Autarky Function for calculating an autarky situation from a MRIO which is the starting world economy situation The MRIO has already undergone a CompoMRIO, and the Save option does a saveRDS in "MRIO_Autarky.rds".
Autarky(dtdl, Optdl = FALSE, OptSaveRDS = FALSE, OptBaseDT = FALSE)
Autarky(dtdl, Optdl = FALSE, OptSaveRDS = FALSE, OptBaseDT = FALSE)
dtdl |
datatable |
Optdl |
binary |
OptSaveRDS |
binary |
OptBaseDT |
binary |
dl data long
Figaro 2022 release, CSV flat format : link : https://ec.europa.eu/eurostat/web/esa-supply-use-input-tables/database#CSV
av_create_FIGAROixi_2022(Path_FIG22ixi, Path_out, OptAnnual = FALSE)
av_create_FIGAROixi_2022(Path_FIG22ixi, Path_out, OptAnnual = FALSE)
Path_FIG22ixi |
path of FIGARO ixi CSV flat format files |
Path_out |
path to save normalized data |
OptAnnual |
option to keep one files by year instead of one file with all years. Can provide a degraded solution if a single database requires too much memory. |
Nothing. Only save data into normalized format.
## Not run: Path_FIG22ixi <- paste0(PathTemp, "ixi/") Path_out <- PathTest av_create_FIGAROixi_2022(Path_FIG22ixi, Path_out, OptAnnual = TRUE) av_create_FIGAROixi_2022(Path_FIG22ixi, Path_out, OptAnnual = FALSE) testAll <- readRDS(paste0(Path_out, "/BDn_FIG.rds")) test2015 <- readRDS(paste0(Path_out, "/BDn_FIG_", 2015, ".rds")) ## End(Not run)
## Not run: Path_FIG22ixi <- paste0(PathTemp, "ixi/") Path_out <- PathTest av_create_FIGAROixi_2022(Path_FIG22ixi, Path_out, OptAnnual = TRUE) av_create_FIGAROixi_2022(Path_FIG22ixi, Path_out, OptAnnual = FALSE) testAll <- readRDS(paste0(Path_out, "/BDn_FIG.rds")) test2015 <- readRDS(paste0(Path_out, "/BDn_FIG_", 2015, ".rds")) ## End(Not run)
av_create_ICIO_2021 ICIO 2021 release, CSV flat format : link : https://www.oecd.org/industry/ind/inter-country-input-output-tables.htm OECD (2021), OECD Inter-Country Input-Output Database, http://oe.cd/icio
av_create_ICIO_2021( Path_ICIO, Path_out, OptAnnual = FALSE, ConvertToEuro = TRUE )
av_create_ICIO_2021( Path_ICIO, Path_out, OptAnnual = FALSE, ConvertToEuro = TRUE )
Path_ICIO |
path of ICIO flat CSV format files |
Path_out |
path to save normalized data |
OptAnnual |
option to keep one files by year instead of one file with all years. Can provide a degraded solution if a single database requires too much memory. |
ConvertToEuro |
Option to convert Dollars to Euros |
Nothing. Only save data into normalized format.
## Not run: Path_ICIO <- PathTemp Path_out <- PathTest av_create_ICIO_2021(Path_ICIO, Path_out, OptAnnual = TRUE, ConvertToEuro = TRUE) test1998Euro <- readRDS(paste0(Path_out, "/BDn_ICIO_", 1998, ".rds")) av_create_ICIO_2021(Path_ICIO, Path_out, OptAnnual = TRUE, ConvertToEuro = FALSE) test1998Dolls <- readRDS(paste0(Path_out, "/BDn_ICIO_", 1998, ".rds")) av_create_ICIO_2021(Path_ICIO, Path_out, OptAnnual = FALSE, ConvertToEuro = TRUE) testEuro <- readRDS(paste0(Path_out, "/BDn_ICIO.rds")) av_create_ICIO_2021(Path_ICIO, Path_out, OptAnnual = FALSE, ConvertToEuro = FALSE) testDolls <- readRDS(paste0(Path_out, "/BDn_ICIO.rds")) head(testEuro) head(testDolls) ## End(Not run)
## Not run: Path_ICIO <- PathTemp Path_out <- PathTest av_create_ICIO_2021(Path_ICIO, Path_out, OptAnnual = TRUE, ConvertToEuro = TRUE) test1998Euro <- readRDS(paste0(Path_out, "/BDn_ICIO_", 1998, ".rds")) av_create_ICIO_2021(Path_ICIO, Path_out, OptAnnual = TRUE, ConvertToEuro = FALSE) test1998Dolls <- readRDS(paste0(Path_out, "/BDn_ICIO_", 1998, ".rds")) av_create_ICIO_2021(Path_ICIO, Path_out, OptAnnual = FALSE, ConvertToEuro = TRUE) testEuro <- readRDS(paste0(Path_out, "/BDn_ICIO.rds")) av_create_ICIO_2021(Path_ICIO, Path_out, OptAnnual = FALSE, ConvertToEuro = FALSE) testDolls <- readRDS(paste0(Path_out, "/BDn_ICIO.rds")) head(testEuro) head(testDolls) ## End(Not run)
av_create_LRWIOD_2022 LR-WIOD 2022 release : link : https://www.rug.nl/ggdc/valuechain/long-run-wiod?lang=en License and funding : Long-run WIOD is licensed under a Creative Commons Attribution 4.0 International License . The construction of the Long-run WIOD was supported by the Dutch Science Foundation (NWO) [grant number 453-14-012].
av_create_LRWIOD_2022(Path_WIODLR, Path_out, ConvertToEuro = TRUE)
av_create_LRWIOD_2022(Path_WIODLR, Path_out, ConvertToEuro = TRUE)
Path_WIODLR |
path of Long-run WIOD flat CSV format files |
Path_out |
path to save normalized data |
ConvertToEuro |
Option to convert Dollars to Euros |
Nothing. Only save data into normalized format.
## Not run: Path_WIODLR <- PathTemp Path_out <- PathTest av_create_LRWIOD_2022(Path_WIODLR, Path_out, ConvertToEuro = TRUE) testEuroDolls <- readRDS(paste0(Path_out, "/BDn_LR_WIOD.rds")) Euros <- testEuroDolls av_create_LRWIOD_2022(Path_WIODLR, Path_out, ConvertToEuro = FALSE) testEuroDolls <- readRDS(paste0(Path_out, "/BDn_LR_WIOD.rds")) dolls <- testEuroDolls ## End(Not run)
## Not run: Path_WIODLR <- PathTemp Path_out <- PathTest av_create_LRWIOD_2022(Path_WIODLR, Path_out, ConvertToEuro = TRUE) testEuroDolls <- readRDS(paste0(Path_out, "/BDn_LR_WIOD.rds")) Euros <- testEuroDolls av_create_LRWIOD_2022(Path_WIODLR, Path_out, ConvertToEuro = FALSE) testEuroDolls <- readRDS(paste0(Path_out, "/BDn_LR_WIOD.rds")) dolls <- testEuroDolls ## End(Not run)
av_create_WIOD_2016 WIOD 2016 release, RData format : link : https://www.rug.nl/ggdc/valuechain/wiod/wiod-2016-release?lang=en Timmer, M. P., Dietzenbacher, E., Los, B., Stehrer, R. and de Vries, G. J. (2015), "An Illustrated User Guide to the World Input–Output Database: the Case of Global Automotive Production" , Review of International Economics., 23: 575–605
av_create_WIOD_2016( Path_WIOD, Path_out, OptAnnual = FALSE, ConvertToEuro = TRUE )
av_create_WIOD_2016( Path_WIOD, Path_out, OptAnnual = FALSE, ConvertToEuro = TRUE )
Path_WIOD |
path of WIOD RData format files |
Path_out |
path to save normalized data |
OptAnnual |
option to keep one files by year instead of one file with all years. Can provide a degraded solution if a single database requires too much memory. |
ConvertToEuro |
Option to convert Dollars to Euros |
Nothing. Only save data into normalized format.
## Not run: Path_WIOD <- PathTemp Path_out <- PathTest av_create_WIOD_2016(Path_WIOD, Path_out, OptAnnual = TRUE, ConvertToEuro = TRUE) test2015Euro <- readRDS(paste0(Path_out, "/BDn_WIOD_", 2013, ".rds")) av_create_WIOD_2016(Path_WIOD, Path_out, OptAnnual = TRUE, ConvertToEuro = FALSE) test2015Dolls <- readRDS(paste0(Path_out, "/BDn_WIOD_", 2013, ".rds")) av_create_WIOD_2016(Path_WIOD, Path_out, OptAnnual = FALSE, ConvertToEuro = TRUE) testEuro <- readRDS(paste0(Path_out, "/BDn_WIOD.rds")) av_create_WIOD_2016(Path_WIOD, Path_out, OptAnnual = FALSE, ConvertToEuro = FALSE) testDolls <- readRDS(paste0(Path_out, "/BDn_WIOD.rds")) ## End(Not run)
## Not run: Path_WIOD <- PathTemp Path_out <- PathTest av_create_WIOD_2016(Path_WIOD, Path_out, OptAnnual = TRUE, ConvertToEuro = TRUE) test2015Euro <- readRDS(paste0(Path_out, "/BDn_WIOD_", 2013, ".rds")) av_create_WIOD_2016(Path_WIOD, Path_out, OptAnnual = TRUE, ConvertToEuro = FALSE) test2015Dolls <- readRDS(paste0(Path_out, "/BDn_WIOD_", 2013, ".rds")) av_create_WIOD_2016(Path_WIOD, Path_out, OptAnnual = FALSE, ConvertToEuro = TRUE) testEuro <- readRDS(paste0(Path_out, "/BDn_WIOD.rds")) av_create_WIOD_2016(Path_WIOD, Path_out, OptAnnual = FALSE, ConvertToEuro = FALSE) testDolls <- readRDS(paste0(Path_out, "/BDn_WIOD.rds")) ## End(Not run)
av_Diff_SPA Function for calculating the difference of Stuctural Path Analysis (SPA) for variant analysis The MRIO can only be in long format here TypeSPA="VA" or "Emi" ListThres = GenThres=,Thres_L2_1=,Thres_L3_1=,Thres_L3_2=,Thres_L3_3,Thres_L3_4=,Thres_L4_1=,Thres_L4_2=,Thres_L4_3,Thres_L4_4=,Thres_L5_1=,Thres_L5_2=,Thres_L5_3,Thres_L5_4=,Thres_L6_1=,Thres_L6_2=,Thres_L6_3,Thres_L6_4=,Thres_L7_1=,Thres_L7_2=,Thres_L7_3,Thres_L7_4= Fitted FIGARO VA : ListThres = GenThres=0.001,Thres_L2_1=0.001,Thres_L3_1=0.001,Thres_L3_2=0.001,Thres_L3_3=0.00001,Thres_L3_4=0.001,Thres_L4_1=0.001,Thres_L4_2=0.001,Thres_L4_3=0.000005,Thres_L4_4=0.001,Thres_L5_1=0.001,Thres_L5_2=0.001,Thres_L5_3=0.000001,Thres_L5_4=0.001,Thres_L6_1=0.001,Thres_L6_2=0.001,Thres_L6_3=0.0000005,Thres_L6_4=0.001,Thres_L7_1=0.001,Thres_L7_2=0.001,Thres_L7_3=0.0000001,Thres_L7_4=0.001 Fitted FIGARO Emi : ListThres = GenThres=0.001,Thres_L2_1=0.0001,Thres_L3_1=0.0001,Thres_L3_2=0.00001,Thres_L3_3=0.000005,Thres_L3_4=0.0001,Thres_L4_1=0.0001,Thres_L4_2=0.00001,Thres_L4_3=0.000005,Thres_L4_4=0.00001,Thres_L5_1=0.001,Thres_L5_2=0.0001,Thres_L5_3=0.000004,Thres_L5_4=0.000001,Thres_L6_1=0.0001,Thres_L6_2=0.00001,Thres_L6_3=0.000004,Thres_L6_4=0.0000001,Thres_L7_1=0.0005,Thres_L7_2=0.00005,Thres_L7_3=0.0000005,Thres_L7_4=0.001
av_Diff_SPA( MRIOdt1, MRIOdt2, ListThres, TypContenu = "VA", TypeMRIO = "FIGARO", PathEmi = "", TargetCountry = "FRA" )
av_Diff_SPA( MRIOdt1, MRIOdt2, ListThres, TypContenu = "VA", TypeMRIO = "FIGARO", PathEmi = "", TargetCountry = "FRA" )
MRIOdt1 |
datatable |
MRIOdt2 |
datatable |
ListThres |
list thresholds |
TypContenu |
text options |
TypeMRIO |
text |
PathEmi |
text path |
TargetCountry |
text country option |
dt data table same format as path analysis (SPA)
## Not run: ListThres = {GenThres=0.001,Thres_L2_1=0.001,Thres_L3_1=0.001,Thres_L3_2=0.001,Thres_L3_3=0.001,Thres_L3_4=0.001,Thres_L4_1=0.001,Thres_L4_2=0.001,Thres_L4_3=0.001,Thres_L4_4=0.001,Thres_L5_1=0.001,Thres_L5_2=0.001,Thres_L5_3=0.001,Thres_L5_4=0.001,Thres_L6_1=0.001,Thres_L6_2=0.001,Thres_L6_3=0.001,Thres_L6_4=0.001,Thres_L7_1=0.001,Thres_L7_2=0.001,Thres_L7_3=0.001,Thres_L7_4=0.001} res<-av_Diff_SPA(MRIOdt_REF, MRIOdt_bis, ListThres, TypContenu = "Emi", PathEmi = PathTemp,) ## End(Not run)
## Not run: ListThres = {GenThres=0.001,Thres_L2_1=0.001,Thres_L3_1=0.001,Thres_L3_2=0.001,Thres_L3_3=0.001,Thres_L3_4=0.001,Thres_L4_1=0.001,Thres_L4_2=0.001,Thres_L4_3=0.001,Thres_L4_4=0.001,Thres_L5_1=0.001,Thres_L5_2=0.001,Thres_L5_3=0.001,Thres_L5_4=0.001,Thres_L6_1=0.001,Thres_L6_2=0.001,Thres_L6_3=0.001,Thres_L6_4=0.001,Thres_L7_1=0.001,Thres_L7_2=0.001,Thres_L7_3=0.001,Thres_L7_4=0.001} res<-av_Diff_SPA(MRIOdt_REF, MRIOdt_bis, ListThres, TypContenu = "Emi", PathEmi = PathTemp,) ## End(Not run)
av_dl_MicroMRIO
av_dl_MicroMRIO(dl, OptXLSout = FALSE)
av_dl_MicroMRIO(dl, OptXLSout = FALSE)
dl |
long data |
OptXLSout |
to export the mini-MRIO in Excel format |
dl micro
## Not run: DT_micro <- av_dl_MicroMRIO(DT, OptXLSout = FALSE) DT_microXls <- av_dl_MicroMRIO(DT, OptXLSout = TRUE) ## End(Not run)
## Not run: DT_micro <- av_dl_MicroMRIO(DT, OptXLSout = FALSE) DT_microXls <- av_dl_MicroMRIO(DT, OptXLSout = TRUE) ## End(Not run)
av_dl_UE27 Build a new MRIO with all EU countries aggragated into "UE27" item. Useful to calculate EU made-in for instance. WARNING : dl must be normalized (not raw data) for countries homogeneity reasons.
av_dl_UE27(dl, OptSaveRDS = "NO")
av_dl_UE27(dl, OptSaveRDS = "NO")
dl |
long data |
OptSaveRDS |
text |
dl with EU27 agreggate instead of each country
## Not run: DT_UE27 <- av_dl_UE27(DT)
## Not run: DT_UE27 <- av_dl_UE27(DT)
av_extend_MRIO_dw Extend MRIO components by adding stressors like Value added or CO2 Emissions You can manage this function to add new cases : other MRIO options or other stressors etc.
av_extend_MRIO_dw(MRIO_dw, NameMRIO, TypExtension, Path1 = NULL)
av_extend_MRIO_dw(MRIO_dw, NameMRIO, TypExtension, Path1 = NULL)
MRIO_dw |
MRIO must be in wide format (not Long) |
NameMRIO |
text |
TypExtension |
text |
Path1 |
text |
dw data wide (list)
## Not run: Bonus <- CompoMRIO(DT, typeCompo = "OptFullOptionsBonus", OptTab = FALSE) MRIO2 <- av_extend_MRIO_dw(MRIO_dw = Bonus, "FIGARO", TypExtension = "StressVA") MRIO3 <- av_extend_MRIO_dw(MRIO_dw = Bonus, "FIGARO", TypExtension = "StressEmi", Path1 = PathTemp) MRIO4 <- av_extend_MRIO_dw(MRIO3, "FIGARO", TypExtension = "StressVA") ## End(Not run)
## Not run: Bonus <- CompoMRIO(DT, typeCompo = "OptFullOptionsBonus", OptTab = FALSE) MRIO2 <- av_extend_MRIO_dw(MRIO_dw = Bonus, "FIGARO", TypExtension = "StressVA") MRIO3 <- av_extend_MRIO_dw(MRIO_dw = Bonus, "FIGARO", TypExtension = "StressEmi", Path1 = PathTemp) MRIO4 <- av_extend_MRIO_dw(MRIO3, "FIGARO", TypExtension = "StressVA") ## End(Not run)
av_fun_VarPostTransition Function for robustness checks by applying structural changes at the wolrd economy to suit climate change Parameters description : - paramEmploi : Employment intensity (value = 0.9 => 10 - paramA : Intermediate consumption substitution intensity: value = 0.9 => the technical coefficient of each country's automotive industry (C29) in products C29 and C28 (domestic and imported) is reduced by 10 - paramDF : The intensity of final consumption substitution: value = 0.9 => each country's final demand for oil products (C19) is reduced by 10 The adjustments made are therefore zero-sum on intermediate consumption and final demand. The simulations are called by their X-Y-Z parameters: for example, 09-08-07 will correspond to a parameter of 0.9 for employment, 0.8 for intermediate consumption and 0.7 for final demand.
av_fun_VarPostTransition(paramEmploi, paramA, paramDF, OptRDS = FALSE)
av_fun_VarPostTransition(paramEmploi, paramA, paramDF, OptRDS = FALSE)
paramEmploi |
value percentage |
paramA |
value percentage |
paramDF |
value percentage |
OptRDS |
binary |
comparison table
## Not run: av_fun_VarPostTransition(paramEmploi = 1, paramA = 1, paramDF = 1) av_fun_VarPostTransition(paramEmploi = 0.9, paramA = 0.8, paramDF = 0.7) ## End(Not run)
## Not run: av_fun_VarPostTransition(paramEmploi = 1, paramA = 1, paramDF = 1) av_fun_VarPostTransition(paramEmploi = 0.9, paramA = 0.8, paramDF = 0.7) ## End(Not run)
av_HRM Master function in the ecosystem : Function HRM (hypothetical repatriation method) repat_pct can come from an other function to calibrate VARIANTs options : OptVarianteDemande : ALL=Normal ; CIdom=CI domestics ; CIall=all CI (dom+exp) ; DFdom=DF domestics ; DFall=all final demand (dom+exp) ; OptVariantePaysImp : ALL=Normal ; <country>= normal but 1 country only ; horsUE=substitution outside EU only We implement a repat_pct repatriation of repat_pct to repatriate 1 Md??? of production, we set the previous repatriation The calculations are transversal to TEI and FD: the entire product is uniformly concerned.
av_HRM( dl, repat_country, repat_indus, repat_pct, verboseCheck = FALSE, OptSommeDFenP3_S14 = TRUE, OptVarianteDemande = "ALL", OptVariantePaysImp = "ALL", OptBaseIntermAvantRecalcProd = TRUE )
av_HRM( dl, repat_country, repat_indus, repat_pct, verboseCheck = FALSE, OptSommeDFenP3_S14 = TRUE, OptVarianteDemande = "ALL", OptVariantePaysImp = "ALL", OptBaseIntermAvantRecalcProd = TRUE )
dl |
datatable |
repat_country |
text country |
repat_indus |
text industry |
repat_pct |
value percentage |
verboseCheck |
binary |
OptSommeDFenP3_S14 |
binary |
OptVarianteDemande |
binary |
OptVariantePaysImp |
binary |
OptBaseIntermAvantRecalcProd |
binary |
list of dl and dw
av_MadeIn Function calculation of MADE-IN
av_MadeIn( dtdl, Optdl = TRUE, annee, OptDonneesBrutes = FALSE, MadeInPays = "FRA", OptUE27 = FALSE )
av_MadeIn( dtdl, Optdl = TRUE, annee, OptDonneesBrutes = FALSE, MadeInPays = "FRA", OptUE27 = FALSE )
dtdl |
data |
Optdl |
binary |
annee |
year |
OptDonneesBrutes |
binary |
MadeInPays |
text country |
OptUE27 |
binary |
dl data long
av_MRIO_comparison Function to compare 2 MRIOs MRIOs can be initially in long format (Optdl) or in wide format (split comparison of all components of the MRIO)
av_MRIO_comparison(MRIO1, MRIO2, Optdl = TRUE, OptVerbose = FALSE)
av_MRIO_comparison(MRIO1, MRIO2, Optdl = TRUE, OptVerbose = FALSE)
MRIO1 |
MRIO object |
MRIO2 |
MRIO object |
Optdl |
long data option |
OptVerbose |
verbose option |
An ordered comparison (if dl) or a list of ordered comparisons (if wide format)
## Not run: M_test <- av_MRIO_comparison(Bonus, BonusBis, Optdl = F, OptVerbose = T)
## Not run: M_test <- av_MRIO_comparison(Bonus, BonusBis, Optdl = F, OptVerbose = T)
av_SPA Master function in the environment : Structural Path Analysis (SPA) Function for calculating the Stuctural Path Analysis (SPA) of a MRIO The MRIO can be in long format or it has already undergone a CompoMRIO (dt) TypeSPA="VA" or "Emi" ListThres = GenThres=,Thres_L2_1=,Thres_L3_1=,Thres_L3_2=,Thres_L3_3,Thres_L3_4=,Thres_L4_1=,Thres_L4_2=,Thres_L4_3,Thres_L4_4=,Thres_L5_1=,Thres_L5_2=,Thres_L5_3,Thres_L5_4=,Thres_L6_1=,Thres_L6_2=,Thres_L6_3,Thres_L6_4=,Thres_L7_1=,Thres_L7_2=,Thres_L7_3,Thres_L7_4= Fitted FIGARO VA : ListThres = GenThres=0.001,Thres_L2_1=0.001,Thres_L3_1=0.001,Thres_L3_2=0.001,Thres_L3_3=0.00001,Thres_L3_4=0.001,Thres_L4_1=0.001,Thres_L4_2=0.001,Thres_L4_3=0.000005,Thres_L4_4=0.001,Thres_L5_1=0.001,Thres_L5_2=0.001,Thres_L5_3=0.000001,Thres_L5_4=0.001,Thres_L6_1=0.001,Thres_L6_2=0.001,Thres_L6_3=0.0000005,Thres_L6_4=0.001,Thres_L7_1=0.001,Thres_L7_2=0.001,Thres_L7_3=0.0000001,Thres_L7_4=0.001 Fitted FIGARO Emi : ListThres = GenThres=0.001,Thres_L2_1=0.0001,Thres_L3_1=0.0001,Thres_L3_2=0.00001,Thres_L3_3=0.000005,Thres_L3_4=0.0001,Thres_L4_1=0.0001,Thres_L4_2=0.00001,Thres_L4_3=0.000005,Thres_L4_4=0.00001,Thres_L5_1=0.001,Thres_L5_2=0.0001,Thres_L5_3=0.000004,Thres_L5_4=0.000001,Thres_L6_1=0.0001,Thres_L6_2=0.00001,Thres_L6_3=0.000004,Thres_L6_4=0.0000001,Thres_L7_1=0.0005,Thres_L7_2=0.00005,Thres_L7_3=0.0000005,Thres_L7_4=0.001
av_SPA( dtdl, Optdl = FALSE, TypeSPA = "VA", TypeMRIO = "FIGARO", ListThres, TargetCountry = "FRA", OptRDS = "", OptRDSDetail = "", OptUE27 = FALSE, verbose = FALSE, PathEmi = "" )
av_SPA( dtdl, Optdl = FALSE, TypeSPA = "VA", TypeMRIO = "FIGARO", ListThres, TargetCountry = "FRA", OptRDS = "", OptRDSDetail = "", OptUE27 = FALSE, verbose = FALSE, PathEmi = "" )
dtdl |
datatable |
Optdl |
binary |
TypeSPA |
text options |
TypeMRIO |
text |
ListThres |
list thresholds |
TargetCountry |
text country |
OptRDS |
binary |
OptRDSDetail |
binary |
OptUE27 |
binary |
verbose |
binary |
PathEmi |
text data link |
dt data table with path analysis results
## Not run: ListThres = {GenThres=0.001,Thres_L2_1=0.001,Thres_L3_1=0.001,Thres_L3_2=0.001,Thres_L3_3=0.001,Thres_L3_4=0.001,Thres_L4_1=0.001,Thres_L4_2=0.001,Thres_L4_3=0.001,Thres_L4_4=0.001,Thres_L5_1=0.001,Thres_L5_2=0.001,Thres_L5_3=0.001,Thres_L5_4=0.001,Thres_L6_1=0.001,Thres_L6_2=0.001,Thres_L6_3=0.001,Thres_L6_4=0.001,Thres_L7_1=0.001,Thres_L7_2=0.001,Thres_L7_3=0.001,Thres_L7_4=0.001}
## Not run: ListThres = {GenThres=0.001,Thres_L2_1=0.001,Thres_L3_1=0.001,Thres_L3_2=0.001,Thres_L3_3=0.001,Thres_L3_4=0.001,Thres_L4_1=0.001,Thres_L4_2=0.001,Thres_L4_3=0.001,Thres_L4_4=0.001,Thres_L5_1=0.001,Thres_L5_2=0.001,Thres_L5_3=0.001,Thres_L5_4=0.001,Thres_L6_1=0.001,Thres_L6_2=0.001,Thres_L6_3=0.001,Thres_L6_4=0.001,Thres_L7_1=0.001,Thres_L7_2=0.001,Thres_L7_3=0.001,Thres_L7_4=0.001}
BoucleAnneesMADEINs Loop to build insight database on MADE-IN 2 options : (1) On the full MRIO database (if memory allows) (2) by year but need to load all the dl and put them into a list (ListdlAnnual)
BoucleAnneesMADEINs( dtdl, Optdl = TRUE, period, OptDonneesBrutes = FALSE, OptAnnual = FALSE, ListdlAnnual = list(), OptUE27 = FALSE )
BoucleAnneesMADEINs( dtdl, Optdl = TRUE, period, OptDonneesBrutes = FALSE, OptAnnual = FALSE, ListdlAnnual = list(), OptUE27 = FALSE )
dtdl |
text |
Optdl |
binary |
period |
time period |
OptDonneesBrutes |
binary |
OptAnnual |
binary |
ListdlAnnual |
list |
OptUE27 |
binary |
dl data long
BoucleLinkageBwdFwd Function loop to calculate Backward and Forward Linkage indicators databases
BoucleLinkageBwdFwd(base_dt, period)
BoucleLinkageBwdFwd(base_dt, period)
base_dt |
datatable |
period |
time period |
dl data long
BouclePaysContVAdesExports Calculation loop of content of value addend embedded in exports for a list of countries and a given year Foster-McGregor, N., et R. Stehrer (2013) : “Value added content of trade : A comprehensive approach,” Economics Letters, 120(2), 354–357.
BouclePaysContVAdesExports( dtdl, Optdl = TRUE, annee, ListCountries = list(), OptUE27 = FALSE )
BouclePaysContVAdesExports( dtdl, Optdl = TRUE, annee, ListCountries = list(), OptUE27 = FALSE )
dtdl |
data |
Optdl |
binary |
annee |
year |
ListCountries |
list |
OptUE27 |
binary |
dl data long
BouclePaysEtAnneesContVAdesExports Calculation loop of content of value addend embedded in exports for a list of countries and a time period (several years) if OptAnnual=TRUE then dtdl must be a list of dtdl Foster-McGregor, N., et R. Stehrer (2013) : “Value added content of trade : A comprehensive approach,” Economics Letters, 120(2), 354–357.
BouclePaysEtAnneesContVAdesExports( dtdl, Optdl = TRUE, period, ListCountries = list(), OptUE27 = FALSE, OptAnnual = FALSE )
BouclePaysEtAnneesContVAdesExports( dtdl, Optdl = TRUE, period, ListCountries = list(), OptUE27 = FALSE, OptAnnual = FALSE )
dtdl |
data |
Optdl |
binary |
period |
time period |
ListCountries |
list |
OptUE27 |
binary |
OptAnnual |
binary |
dl data long
Build_MadeIn_byOrigin Build contents of VA by country of origin
Build_MadeIn_byOrigin( BDn_LR_WIOD, BDn_WIOD, BDn_FIG, BDn_ICIO, SelectCountry = "FRA", OptSaveRDS = FALSE )
Build_MadeIn_byOrigin( BDn_LR_WIOD, BDn_WIOD, BDn_FIG, BDn_ICIO, SelectCountry = "FRA", OptSaveRDS = FALSE )
BDn_LR_WIOD |
datatable |
BDn_WIOD |
datatable |
BDn_FIG |
datatable |
BDn_ICIO |
datatable |
SelectCountry |
text country |
OptSaveRDS |
binary |
dl data long
This function returns the matrix multiplication of 3 matrix as for footprint calculation
CFPcalculationRCPP(ef, L, FD)
CFPcalculationRCPP(ef, L, FD)
ef |
matrix |
L |
matrix |
FD |
matrix |
CompoMRIO Master function in the ecosystem Allow to build Wide MRIO (dw) from Long MRIO (dl), by splitting components You can add other components if needed Afterward you can use av_extend_MRIO_dw() function to extend with environmental data for example
CompoMRIO(MRIO_dl, typeCompo, date = 9999, OptTab = FALSE, OptUE27 = FALSE)
CompoMRIO(MRIO_dl, typeCompo, date = 9999, OptTab = FALSE, OptUE27 = FALSE)
MRIO_dl |
long format MRIO |
typeCompo |
option type of composition |
date |
year |
OptTab |
tabular output option |
OptUE27 |
option with UE27 modality |
dw data wide (list of components)
## Not run: DT <- readRDS(paste0(PathTest, "BDn_FIG_2010.rds")) Bonus <- CompoMRIO(DT, typeCompo = "OptFullOptionsBonus", date = 2010, OptTab = FALSE) ## End(Not run)
## Not run: DT <- readRDS(paste0(PathTest, "BDn_FIG_2010.rds")) Bonus <- CompoMRIO(DT, typeCompo = "OptFullOptionsBonus", date = 2010, OptTab = FALSE) ## End(Not run)
ContentVAExports_Retropolation Retropolation of content in value added of exports WIOD is the reference and LRWIOD is used to retropolate backward, and FIGARO is used to retropolate forward. ICIO is not used here because of systematic retropolation method Very specific task : can be adapted depending on data you're using
ContentVAExports_Retropolation( ContVAdesExports_LRWIOD, ContVAdesExports_WIOD, ContVAdesExports_FIGARO, OptSaveRDS = FALSE )
ContentVAExports_Retropolation( ContVAdesExports_LRWIOD, ContVAdesExports_WIOD, ContVAdesExports_FIGARO, OptSaveRDS = FALSE )
ContVAdesExports_LRWIOD |
datatable |
ContVAdesExports_WIOD |
datatable |
ContVAdesExports_FIGARO |
datatable |
OptSaveRDS |
binary |
dl data long
ContentVAExports_Retropolation_UE27 Retropolation of content in value added of exports for UE27 and big areas Need to aggregate data before to have only one area EU Very specific task : can be adapted depending on data you're using
ContentVAExports_Retropolation_UE27( resMadeInUE27_LRWIOD, resMadeInUE27_WIOD, resMadeInUE27_FIGARO, resMadeInUE27_ICIO, OptGraph = FALSE, OptSaveRDS = FALSE )
ContentVAExports_Retropolation_UE27( resMadeInUE27_LRWIOD, resMadeInUE27_WIOD, resMadeInUE27_FIGARO, resMadeInUE27_ICIO, OptGraph = FALSE, OptSaveRDS = FALSE )
resMadeInUE27_LRWIOD |
datatable |
resMadeInUE27_WIOD |
datatable |
resMadeInUE27_FIGARO |
datatable |
resMadeInUE27_ICIO |
datatable |
OptGraph |
binary |
OptSaveRDS |
binary |
dl data long
Contenus Master function in the ecosystem Function calculation of contents (in VA, émissions CO2, emploi) : allow footprint calculation along different formats WARNING Needs CompoMRIO with bonus and extensions
Contenus(dw, typeContenu, MethContenu = "MatDF", EmprPays = "FRA")
Contenus(dw, typeContenu, MethContenu = "MatDF", EmprPays = "FRA")
dw |
wide data MRIO object |
typeContenu |
text |
MethContenu |
text |
EmprPays |
text country |
dl data long
## Not run: List_Contenus <- Contenus(List_Interm, typeContenu = "VA", MethContenu = "MatDF", EmprPays = SelectCountry)
## Not run: List_Contenus <- Contenus(List_Interm, typeContenu = "VA", MethContenu = "MatDF", EmprPays = SelectCountry)
ContVAdesExports Calculation of content of value addend embedded in exports for a given country and a given year Foster-McGregor, N., et R. Stehrer (2013) : “Value added content of trade : A comprehensive approach,” Economics Letters, 120(2), 354–357.
ContVAdesExports(dtdl, Optdl = TRUE, annee, pays, OptUE27 = FALSE)
ContVAdesExports(dtdl, Optdl = TRUE, annee, pays, OptUE27 = FALSE)
dtdl |
data |
Optdl |
binary |
annee |
year |
pays |
text country |
OptUE27 |
binary |
dl data long
dw_to_dl Convert dw to dl
dw_to_dl(dw)
dw_to_dl(dw)
dw |
wide data |
dl data long
EmissionsProd Function to calculate Inventory Emissions (coming from production) Be careful : [["EmiOverOuput"]] must have been introduced in our MRIO previously (with av_extend_MRIO_dw() function)
EmissionsProd(MRIOinterm)
EmissionsProd(MRIOinterm)
MRIOinterm |
MRIO object |
df data frame
## Not run: EmiProd_MRIO <- EmissionsProd(MRIO)
## Not run: EmiProd_MRIO <- EmissionsProd(MRIO)
GereInfNA Function (very useful) to convert infinity data into NA and NA data into 0 or 1 for example
GereInfNA(df, impute = 0)
GereInfNA(df, impute = 0)
df |
dataframe |
impute |
value to inpute |
df data frame
## Not run: if (TypeSPA == "VA") { f_dt <- vectDF(diag(MRIO[["VAOverOuput"]])) f_dt <- GereInfNA(f_dt) } ## End(Not run)
## Not run: if (TypeSPA == "VA") { f_dt <- vectDF(diag(MRIO[["VAOverOuput"]])) f_dt <- GereInfNA(f_dt) } ## End(Not run)
GetRownamesFromFirstCol Get Rownames From First Column
GetRownamesFromFirstCol(df)
GetRownamesFromFirstCol(df)
df |
dataframe |
df data frame
Herfindahl Function Herfindahl (concentration indicator)
Herfindahl(MRIOinterm, verbose = F)
Herfindahl(MRIOinterm, verbose = F)
MRIOinterm |
MRIO object |
verbose |
binary |
dl data long
ImportedContentInVA Function to calculate the imported content in value added it works with 1 country but you can loop all over the contries available in the MRIO.
ImportedContentInVA(pays)
ImportedContentInVA(pays)
pays |
text country |
dl data long
IndicVariant_IndusCountry Function to calculate differences of indicators resulting from a HRM variant for instance
IndicVariant_IndusCountry( IndusREF, CountryREF = "FRA", ListCountryREF = c("FRA", "DEU", "GBR", "ESP", "ITA"), MRIO, MRIObis, RatioEmploiVA )
IndicVariant_IndusCountry( IndusREF, CountryREF = "FRA", ListCountryREF = c("FRA", "DEU", "GBR", "ESP", "ITA"), MRIO, MRIObis, RatioEmploiVA )
IndusREF |
text industry |
CountryREF |
text country |
ListCountryREF |
list |
MRIO |
MRIO object |
MRIObis |
MRIO object |
RatioEmploiVA |
text data link |
dl data long
Info_MRIO Info_MRIO function: provides information on a product * country (equivalent to branch * country) MRIO must be derived from compoMRIO nb_top : number of crosses to display (ex: nb of countries of origin) Output in print format and save possible.
Info_MRIO(MRIO, Indus_select, Country_select, nb_top = 5, verbose = T)
Info_MRIO(MRIO, Indus_select, Country_select, nb_top = 5, verbose = T)
MRIO |
MRIO object |
Indus_select |
Industry selection |
Country_select |
Country selection |
nb_top |
Number of outputs |
verbose |
verbose option |
text
## Not run: Info_MRIO(MRIO, "A01", "FRA", nb_top = 5) test <- Info_MRIO(MRIO, "C19", "FRA", nb_top = 10) / print(test) ## End(Not run)
## Not run: Info_MRIO(MRIO, "A01", "FRA", nb_top = 5) test <- Info_MRIO(MRIO, "C19", "FRA", nb_top = 10) / print(test) ## End(Not run)
LinkageBwdFwd Function Backward and Forward Linkage
LinkageBwdFwd(base_dt, annee)
LinkageBwdFwd(base_dt, annee)
base_dt |
datatable |
annee |
year |
dl data long
ListsReferential Function to return lists of countries or operations or both You can add lists depending of new MRIO for exemple, or depending of releases
ListsReferential(TypeList)
ListsReferential(TypeList)
TypeList |
Choose the list type |
list
## Not run: if (TypeList == "BRFD_FIG_WIOD_LRWIOD_ICIO") { List_out <- append(ListsReferential("BR_FIG_WIOD_LRWIOD_ICIO"), ListsReferential("FD_FIG_WIOD_LRWIOD_ICIO")) } return(List_out) ## End(Not run)
## Not run: if (TypeList == "BRFD_FIG_WIOD_LRWIOD_ICIO") { List_out <- append(ListsReferential("BR_FIG_WIOD_LRWIOD_ICIO"), ListsReferential("FD_FIG_WIOD_LRWIOD_ICIO")) } return(List_out) ## End(Not run)
MadeIn_byOrigin Calculate MAdeIn by country of origin, for analytics
MadeIn_byOrigin( RESULT_MADEINs_byCountry, SelectCountries = c("FRA", "DEU", "GBR", "ESP", "ITA", "USA", "CHN"), MadeInOf = "FRA", OptSaveRDS = FALSE )
MadeIn_byOrigin( RESULT_MADEINs_byCountry, SelectCountries = c("FRA", "DEU", "GBR", "ESP", "ITA", "USA", "CHN"), MadeInOf = "FRA", OptSaveRDS = FALSE )
RESULT_MADEINs_byCountry |
datatable |
SelectCountries |
list |
MadeInOf |
text country |
OptSaveRDS |
binary |
dl data long
MadeIn_Manuf Calculation of manuf's made-in by agreggation (2 classifications)
MadeIn_Manuf( resMadeIn_LRWIOD, resMadeIn_WIOD, resMadeIn_FIGARO, resMadeIn_ICIO, OptSaveRDS = FALSE )
MadeIn_Manuf( resMadeIn_LRWIOD, resMadeIn_WIOD, resMadeIn_FIGARO, resMadeIn_ICIO, OptSaveRDS = FALSE )
resMadeIn_LRWIOD |
datatable |
resMadeIn_WIOD |
datatable |
resMadeIn_FIGARO |
datatable |
resMadeIn_ICIO |
datatable |
OptSaveRDS |
binary |
dl data long
MadeIn_Retropolation Retropolation of made-in to fit long series inter-MRIO You can manage the MRIO list
MadeIn_Retropolation( resMadeIn_manuf, MadeIn_levels, resMadeIn_LRWIOD, resMadeIn_WIOD, resMadeIn_FIGARO, resMadeIn_ICIO, OptSaveRDS = FALSE )
MadeIn_Retropolation( resMadeIn_manuf, MadeIn_levels, resMadeIn_LRWIOD, resMadeIn_WIOD, resMadeIn_FIGARO, resMadeIn_ICIO, OptSaveRDS = FALSE )
resMadeIn_manuf |
datatable |
MadeIn_levels |
datatable |
resMadeIn_LRWIOD |
datatable |
resMadeIn_WIOD |
datatable |
resMadeIn_FIGARO |
datatable |
resMadeIn_ICIO |
datatable |
OptSaveRDS |
binary |
dl data long
MadeIn_Retropolation_UE27 Retropolation of made-in to fit long series inter-MRIO
MadeIn_Retropolation_UE27( resMadeInUE27_LRWIOD, resMadeInUE27_WIOD, resMadeInUE27_FIGARO, resMadeInUE27_ICIO, OptSaveRDS = FALSE )
MadeIn_Retropolation_UE27( resMadeInUE27_LRWIOD, resMadeInUE27_WIOD, resMadeInUE27_FIGARO, resMadeInUE27_ICIO, OptSaveRDS = FALSE )
resMadeInUE27_LRWIOD |
datatable |
resMadeInUE27_WIOD |
datatable |
resMadeInUE27_FIGARO |
datatable |
resMadeInUE27_ICIO |
datatable |
OptSaveRDS |
binary |
dl data long
This function returns the matrix multiplication of 2 matrix
Mult2_rcpp3(matA, matB)
Mult2_rcpp3(matA, matB)
matA |
matrix |
matB |
matrix |
PasteN Function to concatenate the amounts (in value) of several columns of a DT (in list form)
PasteN(dt, column_ref)
PasteN(dt, column_ref)
dt |
datatable |
column_ref |
column number |
text
## Not run: P2 <- PasteN(DF_TOT_EXP_topN_w, c("Col_Country", "Col_Indus"))
## Not run: P2 <- PasteN(DF_TOT_EXP_topN_w, c("Col_Country", "Col_Indus"))
PastePRBR Paste (Lig_Country and Lig_Indus) into PR and/or (Col_Country and Col_Indus) into BR. Please note: country names, branch names and product names must not contain underscores.
PastePRBR(dl)
PastePRBR(dl)
dl |
data long, like normalized database |
dl data long
## Not run: test <- PastePRBR(DT)
## Not run: test <- PastePRBR(DT)
RatioNoguera Calculation of Noguera indicator
RatioNoguera(BaseResult, nomMRIO)
RatioNoguera(BaseResult, nomMRIO)
BaseResult |
datatable |
nomMRIO |
text name MRIO |
dl data long
ReqSum Query function to calculate a sum from a list of dimensions to be summed ListDimASommer is the normalized list of dimensions on wich you wants to sum up. OptStruct keeps initial format of data bur compute structure on the given list of dimensions (ListDimASommer)
ReqSum(dl, ListDimASommer, OptStruct = FALSE)
ReqSum(dl, ListDimASommer, OptStruct = FALSE)
dl |
data_long format database |
ListDimASommer |
list of dimensions |
OptStruct |
option for structure results |
dl data long
## Not run: Cadre <- Base_depart[["DF"]] Cadre_Tot <- ReqSum(Cadre, "Col_Indus") # Sum components of final demand ## End(Not run)
## Not run: Cadre <- Base_depart[["DF"]] Cadre_Tot <- ReqSum(Cadre, "Col_Indus") # Sum components of final demand ## End(Not run)
rndN Rounding function, default 0 decimal places
rndN(dataa, rnd = 0)
rndN(dataa, rnd = 0)
dataa |
data to round |
rnd |
round decimal option |
rounded value
SoldExtPays Function to calculate external balance for all countries of a MRIO
SoldExtPays(MRIOinterm)
SoldExtPays(MRIOinterm)
MRIOinterm |
MRIO object |
df data frame
## Not run: SoldeExt <- SoldExtPays(MRIO)
## Not run: SoldeExt <- SoldExtPays(MRIO)
SommeDFenP3_S14 Function which sums up all final demand and stores it in P3_14 Caution: potentially biases detailed interpretation of MRIO components On the other hand, remains compatible with all functions and avoids the weird things of P5M (stock variatins that make HRM jump on C22 in particular) Only works with FIGARO at this time, needs more lists if you wants to expand
SommeDFenP3_S14(base_dl)
SommeDFenP3_S14(base_dl)
base_dl |
long database |
dl data long
## Not run: if (OptSommeDFenP3_S14 == TRUE) { Base_init <- SommeDFenP3_S14(data.table::copy(dl)) } ## End(Not run)
## Not run: if (OptSommeDFenP3_S14 == TRUE) { Base_init <- SommeDFenP3_S14(data.table::copy(dl)) } ## End(Not run)
SplitPRBR Split of PR and BR into four parts or only PR or only BR Please note: country names, branch names and product names must not contain underscores.
SplitPRBR(dl)
SplitPRBR(dl)
dl |
data long, like normalized database |
dl data long
## Not run: test <- SplitPRBR(DT)
## Not run: test <- SplitPRBR(DT)
vectDF Function to convert a vector into dataframe
vectDF(vect)
vectDF(vect)
vect |
vector |
df data frame
## Not run: MyDF <- vectDF(DF[, 1])
## Not run: MyDF <- vectDF(DF[, 1])