[R] Using SQL "IN" with RJDBC or RMySQL

David Epstein davideps at umich.edu
Wed Oct 19 15:37:51 CEST 2011


Gabor,

thank you. I just got the script working using paste but your solution
looks good as well. I was not familiar with gsubfn. Appears very useful.

-david


> With gsubfn if  you preface your function with fn$ as shown below then
> it turns on a quasi-perl style string interpolation:
> 
> library(gsubfn)
> organization <- 3
> org_table <- fn$dbGetQuery(conn,""SELECT id,organization_name FROM
> civicrm_contact WHERE contact_type=$organization")
> 
> See ?fn and the gsubfn home page (http://gsubfn.googlecode.com) for details.
>



More information about the R-help mailing list