Description Usage Arguments Value Author(s) Examples
View source: R/parametrized_query.R
In a query string put x1x, x2x and so on characters where you want to insert your strings. Provide a list of of strings and those values will be replaced and query will be ready to be sent to database.
1 | parametrized_query(query, params)
|
query |
String representing your query with x1x, x2x, ... on places where you want to put your parameters |
params |
Vector of strings to be placed in a query on places x1x, x2x,.. respectively. |
A parametrised query ready to be sent to the database.
Elio Bartoš
1 2 3 4 5 6 7 8 9 | query = "
select date, sum(revenue) as revenue
from my_sample_table
where date between 'x1x' and 'x2x'
group by 1
order by 1;
"
p_query = parametrized_query(query, c('2018-09-01', as.character(Sys.Date())))
cat(p_query)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.