Mercurial > repos > mingchen0919 > rmarkdown_collection_builder
diff 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 |
line wrap: on
line diff
--- a/collection_list.Rmd Mon Sep 25 14:28:52 2017 -0400 +++ b/collection_list.Rmd Mon Sep 25 16:19:52 2017 -0400 @@ -14,16 +14,27 @@ ) ``` -```{r} +# Command line arguments + +```{r 'command line arguments'} str(opt) ``` -```{bash 'copy data to working directory', echo=FALSE} -mkdir files_directory -# Copy uploaded data to the working directory -for f in $(echo FILE_LIST | sed "s/,/ /g") -do - cp $f ./files_directory -done -``` \ No newline at end of file +```{r 'rename files'} +# create directory +dir.create('./files_directory') +# get full paths of original files +from_files = strsplit("FILE_LIST", ',')[[1]] +# copy files to the created directory. +file.copy(from_files, './files_directory') +# get original file names +original_files = list.files('./files_directory') +# create new files names from original file names +new_files = gsub('\\.dat', '\\.FORMAT', original_files) +# rename files +file.copy(paste0('./files_directory/', original_files), + paste0('./files_directory/', new_files)) +``` + +# End