You're submitting queries for SQLDF to execute as strings. So, if you want
to use a variable column name, sprintf() or paste() your statement together,
like:
sqldf(sprintf('select sum(%s) as XSUM, Y as Y from testdf group by Y',
var1))
--
Robert Tirrell | r...@stanford.edu | (607) 437-6532
Progra
On Wed, Mar 9, 2011 at 11:41 AM, Mike Schumacher
wrote:
> Fellow R programmers,
>
> I'd like to submit SQLDF statements with R objects as column names.
>
> For example, I want to assign "X" to "var1" (var1<-"X") and then refer to
> "var1" in the SQLDF statement. SQLDF needs to understand that wh
Fellow R programmers,
I'd like to submit SQLDF statements with R objects as column names.
For example, I want to assign "X" to "var1" (var1<-"X") and then refer to
"var1" in the SQLDF statement. SQLDF needs to understand that when I
reference "var1", it should look for "X" in the dataframe.
Th
3 matches
Mail list logo