From Kurt@Horn|k @end|ng |rom wu@@c@@t  Mon Sep 16 08:09:15 2019
From: Kurt@Horn|k @end|ng |rom wu@@c@@t (Kurt Hornik)
Date: Mon, 16 Sep 2019 08:09:15 +0200
Subject: [Rd] =?utf-8?q?Error=3A_package_or_namespace_load_failed_for?=
 =?utf-8?b?4oCYdXRpbHM=?=
In-Reply-To: <CA+JCgN3VBrqXLc+Y=wikf19zkoCRNct2Pof0sVxF82RWN-+T1g@mail.gmail.com>
References: <CA+JCgN39_YGcPH7xgc+O8qbRaXZcc6=kqBVDcgQyGyBGJmgoCQ@mail.gmail.com>
 <CA+JCgN3VBrqXLc+Y=wikf19zkoCRNct2Pof0sVxF82RWN-+T1g@mail.gmail.com>
Message-ID: <23935.9995.170779.414021@hornik.net>

>>>>> Laurent Gautier writes:

> In case a search engine leads someone with the same issue here, I am
> documenting the point I reached:

> I can reproduce the issue with a small example when forcing R to not load
> any package at startup time (using an Renviron file):
> ```
> package <- "utils"
> lib.loc <- "<fill this according to your R install>"
> ns <- loadNamespace(package, lib.loc)
> ```

I cannot reproduce this using current R-devel or R-patched.  After
starting with R_DEFAULT_PACKAGES=NULL,

R> search()
[1] ".GlobalEnv"   "Autoloads"    "package:base"
R> loadedNamespaces()
[1] "compiler" "tools"    "base"    
R> package <- "utils"
R> lib.loc <- file.path(R.home(), "library")
R> ns <- loadNamespace(package, lib.loc)
R> loadedNamespaces()
[1] "compiler" "tools"    "utils"    "base"    

-k

> The code path goes through `registerS3methods(nsInfo$S3methods, package,
> env)` and there to:

> ```
> if (methods::is(genfun, "genericFunction"))
> ```

> The evaluation of `methods::is` reaches the line triggering the error as
> `.identC(class1, class2)` and `.identC(class2, "ANY")` both return `NA` and
> `NA || NA` is not defined:

> ```
>> if (NA || NA) { cat("here\n") }
> Error in if (NA || NA) { : missing value where TRUE/FALSE needed
> ```

> As I understand it `.identC()` should never return `NA`, and if the case
> this would mean that R itself is an unstable state (something at the C
> level that should not have happened has happened) but this was not caught
> earlier.

> 	[[alternative HTML version deleted]]

> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] =?utf-8?q?Error=3A_package_or_namespace_load_failed_for?= =?utf-8?b?4oCYdXRpbHM=?=
Kurt Hornik