rscript arguments input

Solutions on MaxInterview for rscript arguments input by the best coders in the world

showing results for - "rscript arguments input"
01 Feb 2016
1#!/usr/bin/env Rscript
2args = commandArgs(trailingOnly=TRUE)
3# test if there is at least one argument: if not, return an error
4if (length(args)==0) {
5  stop("At least one argument must be supplied (input file).n", call.=FALSE)
6} else if (length(args)==1) {
7  # default output file
8  args[2] = "out.txt"
similar questions
queries leading to this page
rscript arguments input