Mercurial > repos > mingchen0919 > elastic_r_tidyverse
comparison elastic_r_package_render.R @ 9:06f38d3febdc draft default tip
planemo upload
| author | mingchen0919 |
|---|---|
| date | Wed, 28 Mar 2018 23:34:03 -0400 |
| parents | a936b1aff8d3 |
| children |
comparison
equal
deleted
inserted
replaced
| 8:ea3271940757 | 9:06f38d3febdc |
|---|---|
| 7 | 7 |
| 8 #------------import libraries-------------------- | 8 #------------import libraries-------------------- |
| 9 options(stringsAsFactors = FALSE) | 9 options(stringsAsFactors = FALSE) |
| 10 | 10 |
| 11 library(rmarkdown) | 11 library(rmarkdown) |
| 12 library(tidyverse) | |
| 12 #------------------------------------------------ | 13 #------------------------------------------------ |
| 13 | 14 |
| 14 #------------------------------------------------ | 15 #------------------------------------------------ |
| 15 options_and_arguments = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'), | 16 arguments = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/arguments.txt'), |
| 16 sep = '|', header = TRUE) | 17 sep = '|', header = TRUE) |
| 17 | 18 |
| 18 | 19 |
| 19 #-----------------render Rmd-------------- | 20 #-----------------render Rmd-------------- |
| 20 render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/elastic_tool.Rmd'), | 21 render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/elastic_r_package.Rmd'), |
| 21 output_file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/report.html')) | 22 output_file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/report.html')) |
| 22 | 23 |
| 23 # for some unknow reason, directly using REPORT as the input value for output_file parameter | 24 # for some unknow reason, directly using REPORT as the input value for output_file parameter |
| 24 # in the render function can cause empty report file when the tool runs in batch mode. | 25 # in the render function can cause empty report file when the tool runs in batch mode. |
| 25 # the solution is to render the rmarkdown to a explicitly specified file and then copy the | 26 # the solution is to render the rmarkdown to a explicitly specified file and then copy the |
