similar to this question
But how do I clusterExport
a package's non-exported function to a cluster? For some reason this passed my tests before submitting to CRAN but isn't working in production. Obviously, I want to fix and resubmit to CRAN.
library(imputeMulti)
library(parallel)
imputeMulti:::count_compare # function to be exported
nnodes <- 2L
cl <- parallel::makeCluster(nnodes)
parallel::clusterExport(cl, varlist= c("count_compare")) # fails -- but initially passed tests
parallel::clusterExport(cl, varlist= c("count_compare"), envir= as.environment("package:imputeMulti")) # also fails
I'm using cluster export to avoid the CRAN/R CMD check note "use of :::
in package". Obviously, I could export count_compare
, but that's not a desirable choice.
Any help appreciated!
adding tests information:
devtools::test("imputeMulti", "count_levels")
Loading imputeMulti
Testing imputeMulti
int- count_levels works: ...............................
DONE ===========================================================================================================================================