From lgautier at gmail.com  Sat Nov 15 18:49:49 2008
From: lgautier at gmail.com (laurent)
Date: Sat, 15 Nov 2008 18:49:49 +0100
Subject: [Rd] problem with postscript/pdf plots, locales and embedded R
In-Reply-To: <alpine.LFD.2.00.0811141932590.13635@gannet.stats.ox.ac.uk>
References: <1226690614.8615.26.camel@hot-spring>
	<alpine.LFD.2.00.0811141932590.13635@gannet.stats.ox.ac.uk>
Message-ID: <1226771389.23719.14.camel@hot-spring>

Thanks for the quick answer.

The documentation for Sys.setlocale mentions the possibility of warning
when LC_NUMERIC is set.

After checking it is looking like setting LC_NUMERIC from Sys.setlocale
does issue a warning, but there is does not seem to be a warning when
LC_NUMERIC is set in the parent shell. In the case the later is likely
to cause trouble, would it be appropriate to issue a warning when R is
initialized ?



Laurent



On Fri, 2008-11-14 at 19:37 +0000, Prof Brian Ripley wrote:
> On Fri, 14 Nov 2008, laurent wrote:
> 
> > Dear list,
> >
> > A problem with creating pdf or postscript plots from an embedded R, and
> > in an environment where a locale is defined, was recently reported on
> > the rpy (Python->R interface) mailing list.
> >
> > The problem appears to be that whenever the locale defines ',' as a
> > separator for the decimal part of a numerical value, the pdf/ps file
> > generated still has the ',' instead of a '.' causing problem when open
> > the resulting file with a postscript/pdf viewer.
> >
> > Of course, an obvious workaround would be to force the locale for
> > numbers to C ( LC_NUMERIC = "C" ), but that could be overriding
> > internationalization features otherwise in R.
> >
> > Any advice ?
> 
> Don't set LC_NUMERIC with R: ?Sys.setlocale did warn you about that.
> It used to cause far more problems than this.
>



[Rd] problem with postscript/pdf plots, locales and embedded R
laurent