hadley / r-pkgs

Building R packages
https://r-pkgs.org
Other
866 stars 631 forks source link

Expanding on when suggested packages can be assumed available #1078

Open DavidRConnell opened 2 months ago

DavidRConnell commented 2 months ago

I recently submitted a package to CRAN and got a response that a check failed with:

Result: NOTE Package suggested but not available for checking: ‘scRNAseq’

I was following the advice in 17.4 of "r-pkgs"

Similar to our stance in tests (Section 11.5.2), our policy is to write vignettes under the assumption that suggested packages will be installed in any context where the vignette is being built (Section 11.5.3). We generally use suggested packages unconditionally in vignettes. But, as with tests, if a package is particularly hard to install, we might make an exception and take extra measures to guard its use.

Based on this thread on r-package-devel, I believe the error was due to scRNAseq not being in CRAN (but instead bioconductor). Given that it's not particularly hard to install this package, would it be better to suggest assuming packages exist only if they're on CRAN? Or atleast add a warning if trying to submit to CRAN?

It's worth noting that I was specifically told all suggested packages should be used conditionally. I don't think there would have been a complaint if I was only using suggested packages from CRAN but I ended wrapping everything in if--requireNamespace guards (as ugly and distracting as it is) just to follow the request.

-- I assign the copyright of this contribution to Hadley Wickham