-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_common.R
53 lines (41 loc) · 1.65 KB
/
_common.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
knitr::opts_chunk$set(
warning = FALSE
,message = FALSE
,collapse = TRUE
,cache = TRUE
# ,out.width = "70%"
# ,fig.align = 'center'
# ,fig.width = 6
# ,fig.asp = 0.618 # 1 / phi
# ,fig.show = "hold"
)
list.of.packages <- c("ggplot2", "Rcpp", "rstanarm", "lme4", "mice", "VIM", "pander", "kableExtra",
"corrplot", "psych", "ggfortify", "GPArotation", "sjPlot", "gridExtra", "knitr",
"ggmap", "spdep", "housingData", "Hmisc", "waffle", "ROCR", "caret", "ggjoy",
"ggdist", "glmmTMB", "ggpubr",
"stargazer", "missForest", "forestplot", "emo", "tidyr", "factoextra",
"performance", "broom", "dotwhisker", "survey", "marginaleffects", "gtsummary",
"sjPlot", "mice", "palmerpenguins")
## devtools::install_github("hadley/emo")
# issues with MKMisk requiring 'limma' which is in bioconductor
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages>0)){install.packages(new.packages)}
library(ggplot2)
library(gridExtra)
library(dplyr)
library(pander)
library(knitr)
library(kableExtra)
library(sjPlot)
library(broom)
library(ggpubr)
library(gtsummary)
options(knitr.kable.NA = '', knitr.table.format = "html")
theme_set(theme_bw())
# loading data sets used in multiple chapters
depress <- read.delim("data/depress_081217.txt")
names(depress) <- tolower(names(depress))
pen <- palmerpenguins::penguins
load("data/addhealth_clean.Rdata")
addhealth$smoke <- ifelse(addhealth$eversmoke_c=="Smoker", 1, 0)
fev <- read.delim("data/Lung_081217.txt", sep="\t", header=TRUE)