-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_all.R
41 lines (30 loc) · 995 Bytes
/
run_all.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
# TCI index and analyses
#
# setwd('path/to/GHS')
# outputs directory (creates one per day!)
now <- Sys.time()
dname <- paste0( 'run_', strftime(now, format = "%Y%m%d"))
outdir <- file.path( 'outputs', dname )
dir.create(outdir)
dir.create(file.path(outdir,'tables'))
dir.create(file.path(outdir,'figures'))
# view assumptions / parameters
print(ls.str())
# 1. compile data and calculate TCI scores
source('code/00_add_data.R')
# 2. summary maps and figures
source('code/map.R')
source('code/GDP_plots.R')
source('code/HDI_plot.R')
source('code/KOF_HDI.R')
source('code/KOF_plot.R')
source('code/Trade_plot.R')
source('code/regulation_government_plot.R')
# 3. Analyses
require(rmarkdown) # include pandoc in Path system variable
rmarkdown::render('code/stats.Rmd')
file.rename('code/stats.docx',
file.path(outdir, 'stats.docx'))
rmarkdown::render('code/logistic_regression.Rmd')
file.rename('code/logistic_regression.docx',
file.path(outdir, 'logistic_regression.docx'))