From gb at stat.umu.se  Tue Jul 28 16:59:59 2009
From: gb at stat.umu.se (=?ISO-8859-1?Q?G=F6ran_Brostr=F6m?=)
Date: Tue, 28 Jul 2009 16:59:59 +0200
Subject: [Rd] Sys.setlocale
In-Reply-To: <4A6EF6C8.30307@biostat.ku.dk>
References: <4A6EDB0B.4070907@stat.umu.se> <4A6EF6C8.30307@biostat.ku.dk>
Message-ID: <4A6F126F.8070206@stat.umu.se>

Peter Dalgaard wrote:
> G?ran Brostr?m wrote:
>> When checking an R package of mine, I get
>>
>> * checking R files for syntax errors ... WARNING
>> Warning in Sys.setlocale("LC_CTYPE", "en_US") :
>>   OS reports request to set locale to "en_US" cannot be honored
>>
>> 'Sys.setlocale' is not used in any of my R functions. What should I do 
>> to fix the Warning? I have never seen this before.
>>
>> My locale is "sv_SE", on ubuntu 9.04
>>
>>  > sessionInfo()
>> R version 2.9.1 Patched (2009-07-27 r49006)
>> x86_64-unknown-linux-gnu
>>
>> locale:
>> LC_CTYPE=sv_SE;LC_NUMERIC=C;LC_TIME=sv_SE;LC_COLLATE=sv_SE;LC_MONETARY=C;LC_MESSAGES=sv_SE;LC_PAPER=sv_SE;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=sv_SE;LC_IDENTIFICATION=C 
>>
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> G?ran
> 
> The logic is in src/library/tools/R/QC.R (.check_package_code_syntax). 
> If I read correctly, the underlying reason could be that you have 
> "Encoding: latin1" in DESCRIPTION.
> 
> For a workaround, you could play with the R_ENCODING_LOCALES environment 
> variable (documented in R-exts), but I suspect it is easier just to 
> install en_US.

Thanks, I installed en_US and the Warning went away.

G?ran



[Rd] Sys.setlocale
=?ISO-8859-1?Q?G=F6ran_Brostr=F6m?=