[R-pkg-devel] DBI namespace not found on check

Dayne Filer d@yne@|||er @end|ng |rom gm@||@com
Tue Feb 1 18:13:33 CET 2022


Thanks, Ivan! 

I completely missed the warning in the install.out file and had no idea where this was coming from. The object has a slot with a class inheriting from the S4Vectors package. Based on the very helpful thread you suggested, it appears that is the crux. The odd thing is that unlike the ade4 package which was NOT importing anything from the offending sp package, I list S4Vectors as an import. Why would, if the S4Vectors package has some dependencies on the DBI package (probably by way of the AnnotationDbi package?) would DBI not be installed? 

Thanks, All!

Dayne


> On Feb 1, 2022, at 10:14 AM, Ivan Krylov <krylov.r00t using gmail.com> wrote:
> 
> On Tue, 1 Feb 2022 08:27:54 -0500
> Dayne Filer <dayne.filer using gmail.com> wrote:
> 
>> I do not directly import or use any DBI functions.
> 
> 00install.out says:
> 
>>> Warning: namespace ‘DBI’ is not available and has been replaced
>>> by .GlobalEnv when processing object ‘txp_example_model’
> 
> Should the txp_example_model object reference the DBI namespace?
> 
> I don't know the "right" solution here, but a similar problem has been
> discussed here in R-pkg-devel some time ago:
> https://stat.ethz.ch/pipermail/r-package-devel/2022q1/007633.html
> 
> You might have to depend on DBI explicitly because your data() object
> uses it, but then `R CMD check` might object that you don't explicitly
> import anything from it. One admittedly verbose way to work around that
> would be to move the data file to inst/ and load it from
> data/txp_example_model.R only after loadNamespace('DBI'), like some
> data scripts do in the Matrix package.
> 
> -- 
> Best regards,
> Ivan



More information about the R-package-devel mailing list