|
0
|
1 ##============ Sink warnings and errors to a file ==============
|
|
|
2 ## use the sink() function to wrap all code within it.
|
|
|
3 ##==============================================================
|
|
|
4 zz = file(Sys.getenv('TOOL_LOG'))
|
|
|
5 sink(zz)
|
|
|
6 sink(zz, type = 'message')
|
|
|
7
|
|
|
8 #------------import libraries--------------------
|
|
|
9 options(stringsAsFactors = FALSE)
|
|
|
10
|
|
|
11 library(getopt)
|
|
|
12 library(rmarkdown)
|
|
|
13 #------------------------------------------------
|
|
|
14
|
|
|
15 #------------------------------------------------
|
|
|
16 options_and_arguments = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'),
|
|
|
17 sep = '|', header = TRUE)
|
|
|
18
|
|
|
19
|
|
|
20 #-----------------render Rmd--------------
|
|
|
21 render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/dynamic_tool.Rmd'),
|
|
|
22 output_file = Sys.getenv('REPORT'))
|
|
|
23 #------------------------------------------
|
|
|
24
|
|
|
25
|
|
|
26 ##--------end of code rendering .Rmd templates----------------
|
|
|
27 sink()
|
|
|
28 ##=========== End of sinking output============================= |