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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -