Answers for "rscript arguments input"

1

rscript arguments input

#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# test if there is at least one argument: if not, return an error
if (length(args)==0) {
  stop("At least one argument must be supplied (input file).n", call.=FALSE)
} else if (length(args)==1) {
  # default output file
  args[2] = "out.txt"
}
Posted by: Guest on March-27-2020

Code answers related to "rscript arguments input"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language