Skip to content
Snippets Groups Projects
Commit 3d56e9f9 authored by Holger Brandl's avatar Holger Brandl
Browse files

clarified additional arguments

parent 872cbe33
No related branches found
No related tags found
No related merge requests found
......@@ -163,7 +163,7 @@ replaceNA <- function(x, withValue) { x[is.na(x)] <- withValue; x }
## related: http://cran.r-project.org/web/packages/R.cache/R.cache.pdf
cache_it <- function(expr, cacheName=paste0("cache_", substr(digest(expr), 1,6))){
cache_it <- function(expr, cacheName=paste0("cache_", substr(digest::digest(expr), 1,6))){
cacheFile <- paste0(".", cacheName, ".RData")
if(file.exists(cacheFile)){
......
......@@ -15,7 +15,7 @@ suppressMessages(library(docopt))
# retrieve and parse the command-line arguments
doc <- '
Use knitr to spin R documents
Usage: spin.R [options] <r_script> [<script_args>...]
Usage: spin.R [options] <r_script> [<quoted_script_args>]
Options:
-c Cache results
......@@ -26,6 +26,7 @@ Options:
'
#!docopt(doc, "-w test a b c ")$keep
#docopt(doc, "-w test a b c ")$"-w"
#docopt(doc, "$DGE_HOME/dge_analysis.R \"--undirected --qcutoff 0.05 --minfpkm 2 ..\"")
spin_opts <- docopt(doc)
#print(spin_opts)
......@@ -51,7 +52,7 @@ options(width=150)
#https://groups.google.com/forum/#!topic/knitr/ojcnq5Nm298
## better table css: http://www.stat.ubc.ca/~jenny/STAT545A/topic10_tablesCSS.html
commandArgs <- function(trailingOnly = FALSE){ return(as.character(spin_opts$script_args)) }
commandArgs <- function(trailingOnly = FALSE){ return(as.character(spin_opts$quoted_script_args)) }
#print("trimmed args are")
#print(commandArgs())
#print("end args")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment