[Rd] Bug in loadNamespace?

Dirk Eddelbuettel edd at debian.org
Mon Jun 8 03:14:27 CEST 2015

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()

I don't have r-patched handy or I'd try that too.

| > sessionInfo()
| R version 3.2.0 Patched (2015-04-28 r68272)
| Platform: x86_64-apple-darwin13.4.0 (64-bit)
| Running under: OS X 10.9.5 (Mavericks)
| locale:
| [1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
| attached base packages:
| [1] stats     graphics  grDevices utils     datasets  methods   base
| Duncan Murdoch
| ______________________________________________
| R-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-devel

http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the R-devel mailing list