I want to use sqldf and be able to write SQL statements exactly as they would be written in the sql command terminal.
For instance, here is a query from the manual:
Gavg <- sqldf("select g, avg(v) as avg_v from DF group by g")
If I were working with a separate SQL file, the query would be written:
select g,
avg(v) as avg_v
from "DF"
group by g
However, if I were to write this as:
Gavg <- sqldf("
select g,
avg(v) as avg_v
from "DF"
group by g
")
I would like to be able to copy/paste snippets of code into the area around sqldf(" ") without having to escape the quotation marks or having to reference an outside sql file that contains the command.
Is this possible?