-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathX_Run.R
53 lines (46 loc) · 1.34 KB
/
X_Run.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
# Adult X_Run.R file
# TODO:
#-------------------------
# Load packages
#-------------------------
library(here) # setwd in root folder
library(dplyr)
library(vegan)
library(xtable)
library(knitr)
library(kableExtra)
library(mice)
library(ggplot2)
library(viridis)
library(gt)
#-------------------------
# Global options
#-------------------------
# Set analysis method
method <- "mean"
# Set main or soft launch
launch <- "main"
# Decide whether to run long functions or load from file
# long functions generate individual valuesets for each individual
run_long_functions <- 0 # no=0, yes=1
run_scripts <- 0 # no=0, yes=1
# TODO:
#-------------------------
# Run the files
#-------------------------
if (run_scripts == 1) {
source(here("scripts", "helpers", "utils.R"))
source(here("scripts", "1_latent_coefs.R"))
source(here("scripts", "2_anchoring.R"))
source(here("scripts", "3_valueset.R"))
source(here("scripts", "4_heterogeneity.R"))
source(here("scripts", "5_latex_graphs.R"))
# source(here("scripts", "6_latex_tables.R"))
# source(here("scripts", "7_comparison.R"))
# source(here("scripts", "8_kmeans.R"))
#TODO: Save image to prevent rerunning scripts
save.image(here("data", "processed", "image.RData"))
}
# Load final image after running scripts
load(here("data", "processed", "image.RData"))
source(here("scripts", "helpers", "utils.R"))