withargs.R
if (length(commandArgs(trailingOnly=TRUE))>0) {
args <- commandArgs(trailingOnly=TRUE)
}
# library(phangorn)
print(length(args))
if (length(args) < 3) {
stop(" Usage: countSteps.R <alignment.fasta> <tree.nex> <output.txt>", call.=FALSE)
}
cat("You ran the program with ", args,"\n")
new_value <- paste0(args)
using withargs.R
args <- c("a1","b2","c3")
source("withargs.R")
new_value