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

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Tue Feb 1 18:25:45 CET 2022


On 01/02/2022 12:13 p.m., Dayne Filer wrote:
> 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?

S4Vectors is a Bioconductor package, and its current version (0.32.3) 
doesn't list any imports.  It has just one non-base dependency 
(BiocGenerics) and a list of 10 suggested packages.  These dependencies 
may be different if you have a different version.

Normally suggested packages of the one being tested are loaded, but not 
suggested packages of packages it uses.  So it's probably one of those 
suggested packages that needs DBI.

Duncan Murdoch

> 
> 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
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list