view dynamic_tool_render.R @ 1:ddc3c3527f49 draft

test
author mingchen0919
date Fri, 23 Mar 2018 02:01:52 -0400
parents d79569f269c7
children a9579c344a90
line wrap: on
line source

##============ Sink warnings and errors to a file ==============
## use the sink() function to wrap all code within it.
##==============================================================
zz = file(Sys.getenv('TOOL_LOG'))
sink(zz)
sink(zz, type = 'message')

#------------import libraries--------------------
options(stringsAsFactors = FALSE)

library(getopt)
library(rmarkdown)
#------------------------------------------------

#------------------------------------------------
options_and_arguments = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'), 
                                   sep = '|', header = TRUE)


#-----------------render Rmd--------------
render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/dynamic_tool.Rmd'), 
       output_file = Sys.getenv('REPORT'))
#------------------------------------------


##--------end of code rendering .Rmd templates----------------
sink()
##=========== End of sinking output=============================