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

laurent lgautier at gmail.com
Sat Nov 15 18:49:49 CET 2008


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.
>



More information about the R-devel mailing list