getopt and commandArgs examples, and AF/OR update to use getopt()
This commit is contained in:
parent
864f814e1b
commit
f9a8ed3dc7
3 changed files with 66 additions and 21 deletions
14
scripts/getopt-example.r
Executable file
14
scripts/getopt-example.r
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env Rscript
|
||||
require('getopt', quietly=TRUE)
|
||||
|
||||
spec = matrix(c(
|
||||
"drug" , "d", 1, "character",
|
||||
"gene" , "g", 1, "character"
|
||||
), byrow=TRUE, ncol=4)
|
||||
|
||||
opt = getopt(spec);
|
||||
|
||||
drug = opt$drug
|
||||
gene = opt$gene
|
||||
|
||||
cat(c('\nDrug:', drug, '\nGene:', gene, '\n'))
|
Loading…
Add table
Add a link
Reference in a new issue