[Rd] undefined subclass warning

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Thu Jul 1 02:23:27 CEST 2021


   A colleague recently submitted a paper to JSS and was advised to 
address the following warning which occurs when their package 
(https://CRAN.R-project.org/package=pcoxtime) is loaded:

Warning message:
In .recacheSubclasses(def using className, def, env) :
   undefined subclass "numericVector" of class "Mnumeric"; definition 
not updated

After much digging I *think* I've concluded that this comes from the 
following import chain:

pcoxtime -> riskRegression -> rms -> quantreg -> MatrixModels

   that is, loading any of these packages throws the warning. 
MatrixModels Imports: *only* {stats, methods, Matrix} and loading these 
by themselves is warning-less.

    I assume there is some mismatch/incompatibility between MatrixModels 
(which was last updated 2021-03-01) and Matrix (2021-05-24), which has 
this NEWS item in the most release 1.3-3 
<https://cran.r-project.org/web/packages/Matrix/news.html>:

* removed the nowhere used (and unexported but still active) class union 
"Mnumeric" which actually trickled into many base classes properties. 
Notably would it break validity of factor with a proposed change in 
validity checking, as factors were also "Mnumeric" but did not fulfill 
its validity method. Similarly removed (disabled) unused class union 
"numericVector".

    It seems that REINSTALLING the package from source solves the 
problem, which is nice, but I don't fully understand why; I guess ???? 
there are class structures that are evaluated at install time and stored 
in the package environment ...

   Any more explanations would be welcome.

   cheers
     Ben



More information about the R-devel mailing list