getopt and commandArgs examples, and AF/OR update to use getopt()

This commit is contained in:
Tanushree Tunstall 2020-06-18 17:59:28 +01:00
parent 864f814e1b
commit f9a8ed3dc7
3 changed files with 66 additions and 21 deletions

9
scripts/commandArgs-example.r Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env Rscript
print('R Argument Test')
cmd <- paste(commandArgs(), collapse=" ")
cat("How R was invoked:\n");
cat(cmd, "\n")
args <- commandArgs(trailingOnly = TRUE)
cat(c('Command Line Arguments supplied: ', args))