[R-SIG-Mac] Wrong locale when using R from shell

Erich Studerus erich.studerus at bli.uzh.ch
Mon Mar 22 21:32:54 CET 2010


Hello

I'm using Lyx with Sweave on Mac OS X 10.5.8 with R version 2.10.1. When I 
compile Lyx documents, R is called from shell to process R code chunks 
contained in the Lyx document. Unfortunately, R does not automatically 
detect the correct locale when called from shell. I figured out that R uses 
the C locale in shell mode by embedding the following code in Lyx

<<echo=F>>=
sys.getlocale()
@

When I start R from the terminal and also in the R.app I get the correct 
locale:
de_CH.UTF-8/de_CH.UTF-8/C/C/de_CH.UTF-8/de_UTF-8

How I can I get the correct locale when calling R from shell?

Regards,
Erich



More information about the R-SIG-Mac mailing list