comparison collection_list.Rmd @ 1:6be61cb4a1d5 draft

planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
author mingchen0919
date Mon, 25 Sep 2017 16:19:52 -0400
parents 78018b735124
children cb6efa0f0cb6
comparison
equal deleted inserted replaced
0:78018b735124 1:6be61cb4a1d5
12 knitr::opts_chunk$set( 12 knitr::opts_chunk$set(
13 echo = ECHO 13 echo = ECHO
14 ) 14 )
15 ``` 15 ```
16 16
17 ```{r} 17 # Command line arguments
18
19 ```{r 'command line arguments'}
18 str(opt) 20 str(opt)
19 ``` 21 ```
20 22
21 23
22 ```{bash 'copy data to working directory', echo=FALSE} 24 ```{r 'rename files'}
23 mkdir files_directory 25 # create directory
24 # Copy uploaded data to the working directory 26 dir.create('./files_directory')
25 for f in $(echo FILE_LIST | sed "s/,/ /g") 27 # get full paths of original files
26 do 28 from_files = strsplit("FILE_LIST", ',')[[1]]
27 cp $f ./files_directory 29 # copy files to the created directory.
28 done 30 file.copy(from_files, './files_directory')
31 # get original file names
32 original_files = list.files('./files_directory')
33 # create new files names from original file names
34 new_files = gsub('\\.dat', '\\.FORMAT', original_files)
35 # rename files
36 file.copy(paste0('./files_directory/', original_files),
37 paste0('./files_directory/', new_files))
29 ``` 38 ```
39
40 # End