WIthout knowing anything about your research domain, take a look at
what your sql looks like:

"select * from r where V1 like markerinfo$flank1[1] "

You are asking to match literally "markerinfo$flank1[1]" and not the R
object referred to.

Try something more like,

paste("select * from r where V1 like", markerinfo$flank1[1])

Sarah



On Sun, Jun 28, 2020 at 4:35 PM Yuan Chun Ding <ycd...@coh.org> wrote:
>
> Hi R Users,
>
> I tried to use sql in R;  test1 works well,
> library(sqldf)
> test1 <- sqldf("select * from r where V1 like 
> '%GCCATGTCAGCACACTACC%TGAAACCTTTAACTATTT%'")
> test2 <- sqldf("select * from r where V1 like markerinfo$flank1[1] ")
>
> but I want to store the search content in a markerinfo file as shown below
> > markerinfo$flank1[1]
> [1] "%GCCATGTCAGCACACTACC%TGAAACCTTTAACTATTT%"
>
> However, test2 does not work well.
> How to make test2 work?
> Thank you,
>
> Ding
>
>
> ----------------------------------------------------------------------

-- 
Sarah Goslee (she/her)
http://www.numberwright.com

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to