[Bioc-devel] Package checks with WARNING

Hervé Pagès hp@ge@@on@g|thub @end|ng |rom gm@||@com
Thu Oct 13 21:29:40 CEST 2022


On 12/10/2022 13:42, Lapuente Santana, Oscar wrote:

> Hi Hervé,
>
> Thanks for your suggestion.
>
> The package rstatix which I used and it's set as an import, calls the coin package but this one is defined as a suggests in the description file of rstatix package (https://github.com/kassambara/rstatix/blob/master/DESCRIPTION).
>
> In particular, I am calling two two functions from this package: rstatix::wilcox_test and rstatix::wilcox_effsize. The later uses several functions from the coin package and one is called the same way which is coin::wilcox_test and then the warning arises.
>   
> Given this situation, I would feel more comfortable importing the full coin package. What are your thoughts?

I see. But still, you're only supposed to import what your code uses 
_directly_. In this case your code doesn't make any call to coin or 
doesn't use any symbol defined in coin. The code in rstatix does, but 
not your code.

One concern is that you want to make sure that coin is installed on the 
user machine, so it needs to be listed as a dependency. One way to 
achieve this is to move coin to Depends, and to not import anything from 
it. I just tried this but R CMD check now produces:

   * checking dependencies in R code ... NOTE
   Package in Depends field not imported from: ‘coin’
     These packages need to be imported from (in the NAMESPACE file)
     for when this namespace is loaded but not attached.

IMO this is actually a legitimate use of Depends, so I'd say it's ok. At 
least now you get a NOTE instead of a WARNING ;-)

A more hacky solution is to keep coin in Imports and to import an 
arbitrary symbol from it. Could be anything, except 'wilcox_test' of 
course, to avoid the clash with importFrom(rstatix,wilcox_test). That 
should produce a clean R CMD check.

Hope this helps,

H.


>
> Cheers, Óscar
>
> On 12/10/2022, 20:07, "Hervé Pagès" <hpages.on.github using gmail.com> wrote:
>
>      Hi Óscar,
>
>      On 12/10/2022 01:09, Lapuente Santana, Oscar via Bioc-devel wrote:
>
>      > Dear Bioconductor developers/maintainers,
>      >
>      > My package ‘easier’ checks with WARNING in both the current 3.15 release and the devel version.
>      > I am just checking in to see if that’s okay since this was also the case in the first submission (the warning stems from a dependency of a dependency)
>
>      Sure but you can get rid of it by importing only what you need from the
>      coin package. Right now you import the full coin namespace, by having
>      import(coin) in your NAMESPACE file, and that introduces a clash with
>      importFrom(rstatix,wilcox_test) that you also have in there.
>
>      I'm actually not sure what you need coin for (I was not able to find a
>      place in your code where you make any use of it). So maybe you could
>      just drop that dependency entirely?
>
>      Best,
>
>      H.
>
>      >
>      > Thanks in advance,
>      > Cheers, Óscar
>      >
>      > 	[[alternative HTML version deleted]]
>      >
>      > _______________________________________________
>      > Bioc-devel using r-project.org mailing list
>      > https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fbioc-devel&data=05%7C01%7C%7Cb6a12862a3d34c6fc57608daac7c93b1%7Ccc7df24760ce4a0f9d75704cf60efc64%7C1%7C0%7C638011948302682925%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zX2HiEuNhlfF8IQ1N61wbAyt1Sd2k4hiVISTMJXA3qk%3D&reserved=0
>
>      --
>      Hervé Pagès
>
>      Bioconductor Core Team
>      hpages.on.github using gmail.com
>
>
-- 
Hervé Pagès

Bioconductor Core Team
hpages.on.github using gmail.com



More information about the Bioc-devel mailing list