-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.R
66 lines (60 loc) · 1.43 KB
/
init.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
58
59
60
61
62
63
64
65
66
###########################################
#-- Create directories and readme files --#
###########################################
if (!dir.exists("plots")) {
dir.create("plots")
fileConn <- file("plots/README.md")
# write lines to the file connection
writeLines(
c(
"# README",
"",
paste(
"This directory contains plots created by the analysis",
"but are not provided as figures (supplementary or",
"otherwise) in the paper"
)
),
fileConn
)
# close the file connection
close(fileConn)
rm(fileConn)
}
if (!dir.exists("cache")) {
dir.create("cache")
fileConn <- file("cache/README.md")
writeLines(
c(
"# README",
"",
paste(
"This directory stores cached versions of R objects which",
"take a long time to create (such as LCMM fit objects)."
)
),
fileConn
)
close(fileConn)
rm(fileConn)
}
if (!dir.exists("paper")) {
dir.create("paper")
fileConn <- file("paper/README.md")
writeLines(
c(
"# README",
"",
paste(
"This directory contains all figures used in the paper.",
"The sup subdirectory contains supplementary figures"
)
),
fileConn
)
close(fileConn)
rm(fileConn)
}
if (!dir.exists("paper/sup")) dir.create("paper/sup")
if (!dir.exists("plots/residuals")) dir.create("plots/residuals")
if (!dir.exists("plots/ma-nocor")) dir.create("plots/ma-nocor")