-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.R
41 lines (39 loc) · 1.62 KB
/
global.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
#' ---
#' title: "Generic Global R Settings"
#' author: "Alex F. Bokov"
#' date: "08/03/2018"
#' ---
#'
#' This is a script that loads (and if needed, installs)
#' libraries needed for this project, and sets a few global
#' variables that will be needed by many different scripts.
#' Keep this script minimalistic and *no number crunching here*
#'
#' ## Load libraries
#+ warning=FALSE, message=FALSE
source('./functions.R');
source('./trailR.R');
instrequire(c('compiler' # just-in-time compilation
#,'MatchIt','DHARMa' # propensity scores and glm residuals
#,'pscl' # zero-inflated poisson, sigh
,'survival','MASS','Hmisc','zoo','coin' # various analysis methods
#,'survAUC','survivalROC','pROC' # evaluating predictive power
#,'Matrix' # for pd matrices needed by faker()
,'readr','dplyr','stringr','magrittr' # data manipulation & piping
#,'lubridate'
#,'ggplot2','ggfortify','grid','GGally' # plotting
#,'survminer','gridExtra','scales'
#,'stargazer','broom', 'tableone','janitor' # table formatting
#,'knitr','htmltab'
));
#' Turn JIT to max: pre-compile all closures, `for`, `while`, and `repeat` loops
#enableJIT(3);
#' ## Load local config file
#'
source('./config.R');
#' ## Set generic variables
#'
#' data dictionary:
dctfile <- 'DICTIONARY.csv';
#' saved session data (not used right now)
session <- 'session.rdata';