Hello everyone,
I am using RMySQL for a project and I have to deal with a complicated query
here it is :
tmp2 <-sprintf(paste("select Score from YR.Transcription_Factor
inner join YR.Promoter on YR.Transcription_Factor.
Promoter_idPromoter=YR.Promoter.idPromoter
inner join YR.GP_BIS on
YR.Promoter.idPromoter=YR.GP_BIS.Promoter_idPromoter
inner join YR.Gene on YR.GP_BIS.Gene_idGene=YR.Gene.idGene
inner join YR.Cluster on YR.Gene.Cluster_idCluster=YR.Cluster.idCluster
where Cluster_Name='%s' AND Specie='%s' AND
TF_Name='%s' AND
YR.Promoter.Gene_Name in (",toto,")",sep="")
,as.character(TRIPLETS[j,1]),species[i,],as.character(TRIPLETS[j,3]),
titi )
where toto and titi are temporary variables containing
toto <-
noquote(paste(rep(shQuote("%s"),length(in_cluster_tf1$Score)),collapse=","))
titi <- (paste(shQuote(in_cluster_tf1$Gene_Name),collapse=","))
the problem is in quotes ( ' ) and ( ` )
to make it simple how can I create a vector like this
> Vector
"A","B","C" ....
from Initial Vector
> Initial vector
[1] "A" "B" "C" ..
and then inject Vector to the query especialy after " Where X in
("A","B","C")
I tried several methodes with sQuote, dQuote, shQuotes but it seems like I
have a problem with that
Any Idea ?
Thanks
--
**
[[alternative HTML version deleted]]