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"
9}