forked from RMI-PACTA/PACTA_analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
4_report_maker.R
57 lines (41 loc) · 1.65 KB
/
4_report_maker.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
# Website basic Graph Code
# Set Reporting Parameters
options(r2dii_config = paste0(par_file_path, "/ReportParameters.yml"))
# options(encoding = "native.enc")
devtools::load_all()
use_r_packages()
# Set Reporting Parameters
options(r2dii_config = paste0(par_file_path, "/ReportParameters.yml"))
set_report_parameters(paste0(par_file_path, "/ReportParameters.yml"))
# Set the variables for plotting
graph_values()
# List of Portfolios to print
portfolio_overview <- read_csv(paste0(proc_input_path, "/", project_name, "_overview_portfolio.csv"), col_types = set_col_types(grouping_variables, "cclddd"))
portfolio_overview$investor_name <- clean_punctuation(portfolio_overview$investor_name)
portfolio_overview$portfolio_name <- clean_punctuation(portfolio_overview$portfolio_name)
report_list <- get_report_list(portfolio_overview)
# template <- read_utf8_tex(paste0(getwd(),"/Templates/",templateversion,".tex"))
translate_labels(Language)
if (has_sb) {
SB.Values <- GetSovBondCoverage()
}
# i=94
i <- 1
for (i in 1:nrow(report_list)) {
investor_name_select <- report_list$investor_name[i]
portfolio_name_select <- report_list$portfolio_name[i]
investor_type <- report_list$Type[i]
print(paste0(i, " of ", nrow(report_list)))
#######################
### Read in Results ###
########################
set_initial_variables()
test_list <- create_test_list()
results_call()
#########################
### REPORT GENERATION ###
#########################
report_handle <- graph_name("00", ParameterFile)
create_results_folder(project_name, investor_name_select, portfolio_name_select, report_handle)
ReportFigures(explicit_filenames = FALSE)
}