Cran R CMD CHECK with nonstandard system dependencies

I think you probably need to prevent code from the vignettes, tests and examples to be run. Now, as to how to do that there are several solutions (that I know of).

Note I have no idea how Bioconductor handles missing system requirements, whereas for CRAN it's probably easier to escape code (on CI and R-hub your config/DESCRIPTION should help install the program).

I'm curious to see what others answer, and I guess you already know part of the things I'm writing. :slightly_smiling_face:

Knowing whether the software is installed

It makes sense to define a function that'd return TRUE or FALSE depending on whether the commandline program could be found/started. Then it could be used to skip stuff when checking the package, but also in your functions wrapping the program, to give an informative error message to the user telling them to first install the program.

Vignettes

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  purl = NOT_CRAN,
  eval = NOT_CRAN
)
  • You could skip having vignettes and make them "articles" instead, that are present in a pkgdown site but not on CRAN/Bioconductor. googledrive setup. No vignette, no vignette problem. :wink:

(I'm working on a blog post about vignettes for the R-hub blog so I like your question!)

Examples

  • You could skip them conditionally on the software being installed. I.e. the example code would be
if (cool_tool_is_installed() ) {
  cool_package_do()
} 

Tests

Packages with a similar challenge

  • I've mostly given examples of packages whose problem isn't "software available" but "token available" which in a way is similar.
  • I'm thinking of the beastier package, on CRAN, that has a function for installing a software (to an app dir), and one for checking its installation, is_beast2_installed().
2 Likes