[Rd] Bug in loadNamespace?

peter dalgaard pdalgd at gmail.com
Mon Jun 8 10:14:04 CEST 2015


Not happening for me with

R version 3.2.0 Patched (2015-06-05 r68479) -- "Full of Ingredients"
...

> Sys.setlocale(locale='en_US.UTF-8')
[1] "en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8"
>  "320"> "300"
[1] TRUE
>  "320"> "300"
[1] TRUE
>

-pd

> On 08 Jun 2015, at 03:42 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> 
> On 07/06/2015 9:14 PM, Dirk Eddelbuettel wrote:
>> 
>> On 7 June 2015 at 20:46, Duncan Murdoch wrote:
>> | I am seeing very strange behaviour in R 3.2.0 patched (r68272) and a new
>> | build of R-devel.  The sessioninfo() from the former is below.
>> | 
>> | Here's what I see:  If I set the locale, and trigger a namespace load, a
>> | version comparison gives NA, and I get an error.  For example, in a new
>> | session started with R --vanilla from the terminal:
>> | 
>> | > Sys.setlocale(locale='en_US.UTF-8');grid::gpar()
>> | [1] "en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_CA.UTF-8"
>> | Error in if (R_version_built_under < "3.0.0") stop(gettextf("package %s
>> | was built before R 3.0.0: please re-install it",  :
>> |   missing value where TRUE/FALSE needed
>> | 
>> | I've tried debugging this, and the bad lines are these, in loadNamespace:
>> | 
>> | R_version_built_under <- as.numeric_version(built$R)
>> | if (R_version_built_under < "3.0.0") stop(gettextf("package %s was built
>> | before R 3.0.0: please re-install it",
>> |     sQuote(basename(pkgpath))), call. = FALSE, domain = NA)
>> | 
>> | These are in the src/library/base/R/namespace.R file, around line 379.
>> | 
>> | If I stop it before the if and evaluate R_version_built_under, it looks
>> | fine.  If I stop it there and evaluate
>> | 
>> | R_version_built_under < "3.0.0"
>> | 
>> | I get NA.  If I evaluate it again without changing anything, I get FALSE.
>> | 
>> | Does anyone else see this?  Any ideas on what might be the cause?
>> 
>> I don't see it on Ubuntu with a fresh R-devel:
>> 
>> edd at max:~/svn/r-devel$ RD
>> 
>> R Under development (unstable) (2015-06-06 r68485) -- "Unsuffered Consequences"
>> Copyright (C) 2015 The R Foundation for Statistical Computing
>> Platform: x86_64-unknown-linux-gnu (64-bit)
>> 
>> R is free software and comes with ABSOLUTELY NO WARRANTY.
>> You are welcome to redistribute it under certain conditions.
>> Type 'license()' or 'licence()' for distribution details.
>> 
>>  Natural language support but running in an English locale
>> 
>> R is a collaborative project with many contributors.
>> Type 'contributors()' for more information and
>> 'citation()' on how to cite R or R packages in publications.
>> 
>> Type 'demo()' for some demos, 'help()' for on-line help, or
>> 'help.start()' for an HTML browser interface to help.
>> Type 'q()' to quit R.
>> 
>> R> Sys.setlocale(locale='en_US.UTF-8');grid::gpar()
>> [1] "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C"
>> list()
>> R> 
>> 
>> I don't have r-patched handy or I'd try that too.
> 
> Thanks.  It doesn't actually need loadNamespace, it's string comparisons
> that fail.  For example,
> 
> $ R --vanilla
> 
> R version 3.2.0 Patched (2015-04-28 r68272) -- "Full of Ingredients"
> Copyright (C) 2015 The R Foundation for Statistical Computing
> Platform: x86_64-apple-darwin13.4.0 (64-bit)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> 
>  Natural language support but running in an English locale
> 
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> 
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
> 
>> Sys.setlocale(locale='en_US.UTF-8')
> [1] "en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_CA.UTF-8"
>> "320" > "300"
> [1] NA
>> "320" > "300"
> [1] TRUE
> 
> I don't see it in R-devel on Windows.
> 
> Duncan Murdoch
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-devel mailing list