Re: [R] eval() parse() and problem with square brackets

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Tue 23 Jan 2007 - 17:06:33 GMT

If the question is how to represent a character string containing double quotes without using \" then just use single quotes for the entire string instead:

'He said "dog" and she said "cat".'

On 1/23/07, chao gai <chaogai@duineveld.demon.nl> wrote:
> I am just confused by the eval parse \" and such.
> what happens if simplify to :
> g_1 <- sqlQuery(cnn_1, "select aa from bb.[cc\\dd].ee")
> how would the query look in a native sql program?
>
> Cheers,
> Kees
>
> On Tuesday 23 January 2007 17:29, Jakub Jurdziak wrote:
> > Hello,
> >
> > i have problem with the following code (I'm using sqlQuery function from
> > RODBC package):
> > eval(parse(text="g_1 <- sqlQuery(cnn_1, \"select aa from
> > bb.[cc\\dd].ee\")")).
> >
> > I get the error message:
> > "[RODBC] ERROR: Could not SQLExecDirect"
> > "S0002 208 [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object
> > name 'bb.cc\dd.ee'."
> >
> > It seems that R is replacing square brackets that are needed for
> > database to execute query.
> >
> > How can I force R to change its behavior and leave square brackets
> > unchanged?
> >
> > Any ideas appreciated.
> >
> > Kuba
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html and provide commented, minimal,
> > self-contained, reproducible code.
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed Jan 24 04:10:44 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 23 Jan 2007 - 18:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.