Commit 4567aff3 authored by Holger Brandl's avatar Holger Brandl

changed to copy script to working directory before spinning

parent ef631199
......@@ -57,13 +57,21 @@ commandArgs <- function(trailingOnly = FALSE){ return(as.character(spin_opts$quo
#print(commandArgs())
#print("end args")
## todo use temp-file-name here to allow for cocurring spin.R in same directory
## copy R-script to working directory and forget about the original one
#file.copy(r_script, basename(r_script))
system(paste("cat ", r_script," | grep -Ev '^#+$' | grep -Fv '#!/usr/bin/env Rscript' >", basename(r_script)))
r_script <- basename(r_script)
spin(r_script, knit=F)
file.remove(basename(r_script))
rmdScript <- str_replace(r_script, "[.]R$", ".Rmd")
system(paste("mv", rmdScript, "tmp.Rmd"))
system(paste("cat tmp.Rmd | grep -Ev '^#+$' | grep -Fv '#!/usr/bin/env Rscript' >", basename(rmdScript)))
file.remove("tmp.Rmd")
# system(paste("mv", rmdScript, "tmp.Rmd"))
#system(paste("cat tmp.Rmd | grep -Ev '^#+$' | grep -Fv '#!/usr/bin/env Rscript' >", basename(rmdScript)))
#file.remove("tmp.Rmd")
cssHeader='
<style type="text/css">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment