-
Notifications
You must be signed in to change notification settings - Fork 0
/
prescript.R
91 lines (67 loc) · 1.98 KB
/
prescript.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
l <- readLines("rxode2/R/rxsolve.R")
w <- which(regexpr("@param", l) != -1)
l <- l[-seq(1, w[1] - 1)]
w <- which(regexpr("@return", l) != -1)
l <- l[seq(1, w[1] - 1)]
l <- sub("#+' *", "", l)
l <- gsub("@param *([^ ]*)", "### \\1\n`\\1`", l)
w <- which(regexpr("@inheritParams", l) != -1)
if (length(w) > 0) l <- l[-w]
l[1] <- paste0("## General Solving Options\n\n", l[1])
w <- which(regexpr("atol", l) != -1)
if (length(w) > 0){
w <- w[1]
l[w] <- paste0("## lsoda/dop solving options\n\n", l[w])
}
w <- which(regexpr("indLinMatExpType", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## Inductive Linerization Options\n\n", l[w])
}
w <- which(regexpr("minSS", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## Steady State Solving Options\n\n", l[w])
}
w <- which(regexpr("maxAtolRtolFactor", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## rxode2 numeric stability options\n\n", l[w])
}
w <- which(regexpr("sensType", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## Linear compartment model sensitivity options\n\n", l[w])
}
w <- which(regexpr("iCov", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## Covariate Solving Options\n\n", l[w])
}
w <- which(regexpr("seed", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## Simulation options\n\n", l[w])
}
w <- which(regexpr("returnType", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## rxode2 output options\n\n", l[w])
}
w <- which(regexpr("nDisplayProgress", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## Internal rxode2 options\n\n", l[w])
}
w <- which(regexpr("cores", l) != -1)
if (length(w) > 0) {
w <- w[1]
l[w] <- paste0("## Parallel/Threaded Solve\n\n", l[w])
}
l2 <- readLines("07-solving.Rmd")
w <- which(regexpr("below", l2) != -1)
l2 <- l2[1:w]
writeLines(c(l2, "", "", l), "07-solving.Rmd")
for (f in list.files("rxode2/vignettes/",pattern="\\.png$")) {
file.copy(file.path("rxode2/vignettes/", f), f)
}