Re: [Rd] Inconsistent behavior of sQuote and dQuote

From: Marc Schwartz <marc_schwartz_at_comcast.net>
Date: Sun, 14 Oct 2007 11:18:14 -0500

On Sun, 2007-10-14 at 11:56 -0400, Duncan Murdoch wrote:
> On 14/10/2007 10:44 AM, cstrato wrote:
> > Dear all
> >
> > When comparing sQuote("text") and dQuote("text") on MacOS X and Linux FC4
> > I get an inconsistent behavior (using the new release version R-2.6.0):
> >
> > sQuote: On Mac I get the correct result "'text'", but on FC4 the
> > incorrect result "`text´".
>
> Those both look correct to me (but not the same). What do you see?
>
> > dQuote: On Mac I get the correct result "\"text\"", but on FC4 the
> > incorrect result ""text"".
>
> The second one looks wrong here (no escapes shown), but I suspect those
> inner quotes aren't really the same as the outer quotes, and that's why
> they're not escaped.
>
> If you don't want the fancyquotes at all, you can use
> options(useFancyQuotes=FALSE). In a package, it would be polite to do
> this only locally, i.e. have something like
>
> save <- options(useFancyQuotes=FALSE)
> on.exit(options(save))
>
> in functions that call sQuote or dQuote, because options() belong to the
> user, not to you.

FWIW, on F7 I get:

> sQuote("text")

[1] "‘text’"

> dQuote("text")

[1] "“text”"

options(useFancyQuotes = FALSE)

> sQuote("text")

[1] "'text'"

> dQuote("text")

[1] "\"text\""

The differing behavior between OS X and FC4 is perhaps due to the available character sets and the locales, presuming that they may not be the same. See the Details section of ?sQuote.

I might also point out that FC4 has been EOL for some time. It would be prudent to consider updating to a more recent version. FC6 and F7 are the currently maintained releases, with F8 due to be released on November 8.

HTH, Marc Schwartz



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 14 Oct 2007 - 16:19:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 25 Oct 2007 - 11:37:11 GMT.

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