getting a package on CRAN to pass winbuilder tests (to get it on CRAN) with a linux specific package (doMC)

140 Views Asked by At

So, I'm ready to get my package on CRAN, but I have used the doMC package, which is only available on linux on CRAN (it is available on R-forge for windows). I don't get any errors on devtools:check(), but I do get the following error back when CRAN tries to build it with winbuilder. I imagine there are packages that use that package and the doMC package itself is linux specific.

Here is the error: * checking package namespace information ... OK * checking package dependencies ... ERROR Package required but not available: 'doMC'

See section 'The DESCRIPTION file' in the 'Writing R Extensions' manual. * DONE Status: 1 ERROR, 1 NOTE

2

There are 2 best solutions below

0
James Dalgleish On BEST ANSWER

Ralf Stubner's answer works best. I changed everything to doParallel and it works fine. "Why do you use doMC and not doParallel or doFuture?"

4
boshek On

I'd just add something like:

doMC - Package not available for Windows

Then if you want to get a little more rigorous add this to where you use actually use a function for doMC:

if (!requireNamespace("doMC")) {
  stop("package doMC required to do this thing....")
}