[Rd] Error: package or namespace load failed for ‘utils

Laurent Gautier |g@ut|er @end|ng |rom gm@||@com
Sun Sep 15 21:01:09 CEST 2019


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

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]]



More information about the R-devel mailing list