Skip to content

Instantly share code, notes, and snippets.

@qoelet
Created January 13, 2014 05:30
Show Gist options
  • Save qoelet/8395193 to your computer and use it in GitHub Desktop.
Save qoelet/8395193 to your computer and use it in GitHub Desktop.
# Django templating style variable interpolation via https://github.com/jokergoo/GetoptLong
library(GetoptLong)
country <- "SG"
my_query <- "SELECT * FROM my_table WHERE country='{{country}}';"
my_query <- qq(my_query, code.pattern="\\{\\{CODE\\}\\}")
cat(my_query)
"
> cat(my_query)
SELECT * FROM my_table WHERE country='SG';
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment