[R] help in paste command

2012-04-05 Thread arunkumar1111
i have a character variable
tablename=DressMaterials
var1=(red,blue,green,white)

My output should be like

select  * from DressMaterialswhere colors in (red,blue,green,white)

i'm not able to get the where part.

my code 

paste(select * from , tablename ,  where colors in ,paste(var1,
collapse=,))

But i'm not able to get required result


-
Thanks in Advance
Arun
--
View this message in context: 
http://r.789695.n4.nabble.com/help-in-paste-command-tp4534756p4534756.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] help in paste command

2012-04-05 Thread mlell08
Hello Arun,

 paste(select * from , tablename ,  where colors in
(,paste(var1,collapse=,),))
[1] select * from  DressMaterials  where colors in (
red,blue,green,white )

Regards!

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] help in paste command

2012-04-05 Thread David Winsemius


On Apr 5, 2012, at 8:55 AM, arunkumar wrote:


i have a character variable
tablename=DressMaterials
var1=(red,blue,green,white)

My output should be like

select  * from DressMaterialswhere colors in  
(red,blue,green,white)


i'm not able to get the where part.


?match



my code

paste(select * from , tablename ,  where colors in ,paste(var1,
collapse=,))

But i'm not able to get required result




David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] help in paste command

2012-04-05 Thread arunkumar1111
Thanks Lell

It worked well.

-
Thanks in Advance
Arun
--
View this message in context: 
http://r.789695.n4.nabble.com/help-in-paste-command-tp4534756p4534925.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.