command line arguments - R Paste multiple -


i taking in multiple command line parameters within r script such :

args<-commandargs(true) arg1 <- as.numeric(args[1]) arg2 <- as.numeric(args[2]) 

i wanting use these args within paste string below. problem can figure out how use 1 of arguments , not both (arg1, arg2). instead of "xxx" show below in clause (i.e. "columnname1 in (xxx)") how use "arg1" command line parameter in place of "xxx"? i've tried number of different ways , reason can't figure out. should concatenate 2 different strings accomplish or there easier way?

sql<-paste( "select   *  table  columnname1 in (xxx)  ,  columnname2 in ('",arg2,"')",sep = "") 

thanks help!

try:

sql<-paste( "select   *  table  columnname1 in ('",arg1,"')  ,  columnname2 in ('",arg2,"')",sep = "", collapse="") 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -