-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.R
61 lines (47 loc) · 1.68 KB
/
index.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
#!/SYSTEM/R/3.5.1/bin/Rscript
# `simrc` should contain `module load gcc/5.3.0` and `module load R/3.5.1`
options(bitmapType='cairo')
if (length(intersect(dir(), "result")) == 0) { system("mkdir result") }
if (Sys.info()['sysname'] == 'Linux') { .libPaths("./Rlib") } # for user-installed libs
library(knitr)
library(compiler)
library(lattice)
library(dplyr)
library(tidyr)
library(readr)
library(nmw)
library(optparse)
# 2. main ----
# nTheta x 2 ; number of Theta
# nEta x 1 ; number of Eta
# nEps x 1 ; number of Epsilon
# THETAinit x~x 10 100 ; Theta initial value
# OMinit x 0.2 ; Omega initial value
# SGinit x 1 ; Sigma initial value
option_list <- list(
optparse::make_option(c("-i", "--input"),
type='character',
help="Input file path",
default="input/ZERO.inp",
metavar="character")
)
arguments <- optparse::parse_args(optparse::OptionParser(option_list=option_list),
args = commandArgs(trailing=TRUE)) %>%
print()
inputFirst <- read_delim(arguments$input,
delim = '=',
col_names = c('name', 'value')) %>%
mutate_all(funs(trimws)) %>%
print()
write_csv(inputFirst, "result/inputFirst.csv")
# 3. report ----
knitr::knit2html("README.Rmd",
"result/README.html",
options = c("toc", "mathjax"),
force_v1 = TRUE, encoding = 'UTF-8')
system("cp -rf cover.jpg figure xyplot.jpg result")
print("Complete.")
# current status
print(sapply(.libPaths(), dir))
print(capabilities())
print(sessionInfo())