forked from RMI-PACTA/PACTA_analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_portfolio_check_initialisation.R
50 lines (36 loc) · 1.51 KB
/
1_portfolio_check_initialisation.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
## Project Initialisation
rm(list = ls())
options(encoding = "UTF-8")
devtools::load_all()
use_r_packages()
## Project Initialisation
rm(list = ls())
if (rstudioapi::isAvailable()) {
working_location <- dirname(rstudioapi::getActiveDocumentContext()$path)
} else {
working_location <- getwd()
}
working_location <- paste0(working_location, "/")
setwd(working_location)
source("0_portfolio_test.R")
source("0_graphing_functions.R")
source("0_reporting_functions.R")
source("0_portfolio_input_check_functions.R")
source("0_global_functions.R")
source("0_sda_approach.R")
project_name <- "BondsTest"
twodii_internal <- TRUE
run_remotely <- FALSE
# TRUE or FALSE: TRUE means that the code is running on a 2dii laptop with dropbox connection
#####################################################################
### ONLY FOR EXTERNAL PROJECTS (twodii_internal <- FALSE):
# Variables must exist for internal projects
project_location_ext <- "C:/Users/clare/Desktop/ExternalTest"
data_location_ext <- "C:/Users/clare/Desktop/Git/pacta-data/2019Q4"
#####################################################################
create_project_folder(project_name, twodii_internal, project_location_ext)
set_project_paths(project_name, twodii_internal, project_location_ext)
copy_files(project_name)
options(r2dii_config = paste0(par_file_path, "/AnalysisParameters.yml"))
set_global_parameters(paste0(par_file_path, "/AnalysisParameters.yml"))
analysis_inputs_path <- set_analysis_inputs_path(twodii_internal, data_location_ext, dataprep_timestamp)