[R-pkg-devel] "Warning: replacing previous import" in reverse dependencies
Ott Toomet
otoomet @end|ng |rom gm@||@com
Sun Sep 7 23:38:23 CEST 2025
I am trying to understand/fix the reverse dependency warnings I get with
the new version of my maxLik package (see
https://github.com/arne-henningsen/maxLik). For a number of packages,
e.g. for censReg, I get a warning:
Warning: replacing previous import ‘maxLik::nobs’ by ‘stats::nobs’ when
loading ‘censReg’
I think this is related to the fact that the new version of maxLik imports
the S4 version of nobs, instead of miscTools' nObs. The relevant part of
the NAMESPACE is
...
importFrom("stats4", "nobs")
...
However, censReg imports the S3 version after importing maxLik (it's
NAMESPACE):
...
import( "maxLik" )
...
importFrom( "stats", "nobs" )
...
(I may be wrong with my interpretation though.)
Is it something that I should address, or is it an issue with censReg
package in this case? I can get the warning to go away if I re-order the
imports in censReg (generic nobs first, maxLik afterward).
Any enlightenment appreciated :-)
Ott
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list