-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathmain.R
60 lines (41 loc) · 1.39 KB
/
main.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 0_prep ------------------------------------------------------------------
library("data.table") # 1.12.0
library("comtradr") # 0.2.2
# library("openxlsx") # 4.1.0
source("R/00_prep_functions.R")
# Will download required ZIP files and convert the contents to RDS
source("R/00_prep_fao.R")
# Requires EIA and IEA CSV files that are available from:
# https://www.eia.gov/opendata/qb.php?category=2135203 (in 1000 bbl/d)
# http://dx.doi.org/10.1787/data-00550-en
source("R/00_prep_eth.R")
# Requires BACI92 ZIP files as well as data.table::rbindlist(comtrade)
source("R/00_prep_trade.R")
# Depends on outputs produced in step 0
source("R/01_tidy_fao.R")
source("R/01_tidy_eth.R")
source("R/01_tidy_trade.R")
# Build full BTD, integrating trade data
source("R/02_build_btd.R")
# Build full CBS, integrating production data, etc.
source("R/03_build_cbs.R")
# Estimate trade shares from the CBS
source("R/04_estimate_btd.R")
# Balance trade using RAS
source("R/05_balance.R")
# Allocate re-exports
source("R/06_re-exports.R")
# Create the supply structure
source("R/07_supply.R")
# Create the use structure
source("R/08_use.R")
# Build multi-regional supply use tables
source("R/09_mrsut.R")
# Build MRIO blocks
source("R/10_mrio.R")
# Derive Leontief inverses
source("R/11_leontief_inverse.R")
# Prepare env. extensions
source("R/12_extensions.R")
# Create sheets with IO codes for users
source("R/13_codes.R")