Hi I would like to change the locale when using R CMD BATCH. Usually, if I want to run it in english, for R in console/GUIs, I edit the .Rprofile file, adding: Sys.setlocale("LC_ALL","en_US.UTF8") Sys.setlocale("LC_MESSAGES","en_US.UTF8") But while this works for interactive R, it does not for R CMD BATCH. The problem is that running tests for a package, these are run in a non-english locale, but R CMD check runs them in english locale, giving me messages about mismatches between *.R and *.Rout.save like: < Warning messages: ---> Messages d'avis :Does anyone know how to specify the locale for R CMD BATCH? Is'nt it supposed to read the .Rprofile? It seems R CMD BATCH should, given that there is the option not to read it... (cf. --no-init-file) Thanks! Matthieu [[alternative HTML version deleted]]
Hi, how about export LC_ALL=C Sidenote: Maybe more a question for r-help as it is not Debian specific? Kind regards, Johannes Am Mittwoch 24 Oktober 2012, 20:32:22 schrieb Matthieu Stigler:> Hi > > I would like to change the locale when using R CMD BATCH. Usually, if I > want to run it in english, for R in console/GUIs, I edit the .Rprofile > file, adding: > Sys.setlocale("LC_ALL","en_US.UTF8") > Sys.setlocale("LC_MESSAGES","en_US.UTF8") > > But while this works for interactive R, it does not for R CMD BATCH. The > problem is that running tests for a package, these are run in a non-english > locale, but R CMD check runs them in english locale, giving me messages > about mismatches between *.R and *.Rout.save like: > < Warning messages: > --- > > > Messages d'avis : > Does anyone know how to specify the locale for R CMD BATCH? Is'nt it > supposed to read the .Rprofile? It seems R CMD BATCH should, given that > there is the option not to read it... (cf. --no-init-file) > > Thanks! > > Matthieu > > [[alternative HTML version deleted]] > > _______________________________________________ > R-SIG-Debian mailing list > R-SIG-Debian at r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-debian
Hi Thanks for your help! I tried the solution export LC_ALL=C but it does not change the behaviour, see: $ export LC_ALL=C $ more file.R log(-2) $ R CMD BATCH file.R $ more +19 file.Rout> log(-2)[1] NaN Message d'avis : In log(-2) : production de NaN Any idea on how to do? Not sure what you meant by changing the linux LOCAL environment? Would that be a global change affecting other software/systems? Maybe my question could be asked on the general help list, although this concerns specifically the R setting on Debian/Ubuntu! So hope you will be indulgent with this :-) Thanks! Matthieu 2012/10/25 z <z@debian>> Try to change the Linux LOCAL environment. Perhaps it will work. > >[[alternative HTML version deleted]]