charles loboz [EMAIL PROTECTED] wrote:
A gstring is a string with variable names embedded and replaced by
values(converted to strings, lazy eval) before use.
I use the following function, which will take variables either from
named arguments or from the environment. It also concatenates all
Hi,
In Bioconductor, we have something called copySubstitute, which does
what you want, I believe,
x=select @var1@ from @tab1@
copySubstitute(textConnection(x), symbolValues= list(var1=Race,
tab1=ReallyBigTable), dest=stdout())
yields
select Race from ReallyBigTable
you can read in from
The other thing to use is 'sprintf', which would be fantastic in R if it
imputed types based on the format string.
As it is now, for your query you would do:
sprintf(SELECT %s FROM table WHERE date = '%s', column, 2005-10-12)
[1] SELECT column FROM table WHERE date = '2005-10-12'
Which, in my
On 07-May-05 James Bullard wrote:
The other thing to use is 'sprintf', which would be fantastic in R if
it imputed types based on the format string.
As it is now, for your query you would do:
sprintf(SELECT %s FROM table WHERE date = '%s', column,
2005-10-12)
[1] SELECT column FROM table
On Sat, 7 May 2005, James Bullard wrote:
The other thing to use is 'sprintf', which would be fantastic in R if it
imputed types based on the format string.
But it does in 2.1.0, the current version.
As it is now, for your query you would do:
sprintf(SELECT %s FROM table WHERE date = '%s', column,
On 5/7/05, charles loboz [EMAIL PROTECTED] wrote:
Currently in R, constructing a string containing
values of variables is done using 'paste' and can be
an error-prone and traumatic experience. For example,
when constructing a db query we have to write,
paste(SELECT value FROM table