Repository navigation
Expand file tree
/
Copy pathReportGenerator.R
More file actions
58 lines (54 loc) · 2.49 KB
/
Copy pathReportGenerator.R
File metadata and controls
58 lines (54 loc) · 2.49 KB
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
# Run this script to generate all the country PDF reports and load them into the
# read folder of the shinyTCMN app
##################################
# setwd() to handle images and other files
setwd('/Users/asanchez3/Desktop/Work/TCMN/ReportGenerators/')
source('generic_functions.R') # data and functions needed
# Create the data reports --------------------------------------
#for (c in c("Andorra")) {
for (c in countryNames$Country) {
iso3 <- .getCountryCode(c)
knit2pdf('TCMN_PDF_Local.Rnw', clean = TRUE,
encoding = "UTF-8",
output = paste0("TCMN_",iso3,".tex"))
# copy file to shinyTCMN pdf directory
file.copy(paste0("TCMN_",iso3,".pdf"), "/Users/asanchez3/shinyTCMN/pdf/",overwrite=TRUE)
}
# Create the operations reports --------------------------------------
for (c in countryNames$Country) {
#for (c in c("Brazil")) {
iso3 <- .getCountryCode(c)
knit2pdf('TCMN_Operations_PDF_Local.Rnw', clean = TRUE,
encoding = "UTF-8",
output = paste0("TCMN_Operations_",iso3,".tex"))
# copy file to shinyTCMN pdf directory
file.copy(paste0("TCMN_Operations_",iso3,".pdf"), "/Users/asanchez3/shinyTCMN/pdf/",overwrite=TRUE)
}
# Create the combined FULL reports --------------------------------------
for (c in countryNames$Country) {
#for (c in c("Brazil","Bolivia", "Andorra")) {
iso3 <- .getCountryCode(c)
knit2pdf('TCMN_Full_PDF_Local.Rnw', clean = TRUE,
encoding = "UTF-8",
output = paste0("TCMN_Full_",iso3,".tex"))
# copy file to shinyTCMN pdf directory
file.copy(paste0("TCMN_Full_",iso3,".pdf"), "/Users/asanchez3/shinyTCMN/pdf/",overwrite=TRUE)
}
# Create the Combined Region Departments reports --------------------------------------
for (couDep in unique(countryDeps$CMU)) {
#for (couDep in c("AFCF1")) {
knit2pdf('TCMN_RegionDeps_PDF_Local.Rnw', clean = TRUE,
encoding = "UTF-8",
output = paste0("TCMN_RegionDeps_",couDep,".tex"))
# copy file to shinyTCMN pdf directory
file.copy(paste0("TCMN_RegionDeps_",couDep,".pdf"), "/Users/asanchez3/shinyTCMN/pdf/",overwrite=TRUE)
}
# Create the RMarkdown operations reports --------------------------------------
#for (c in countryNames$Country) {
# for (c in c("Peru")) {
# iso3 <- .getCountryCode(c)
# knit2html('TCMN_Operations_TEST.Rmd',
# output = paste0("TCMN_Operations_TEST_",iso3,".html"))
# # copy file to shinyTCMN pdf directory
# #file.copy(paste0("TCMN_Operations_",iso3,".pdf"), "/Users/asanchez3/shinyTCMN/pdf/",overwrite=TRUE)
# }