How to disable --as-cran from the "check package" IDE command


I’m in a difficult situation where I am developing a package for internal use in a secure environment. Critically this means that there is no outside internet connection. When the check runs it chokes when checking the CRAN and Bioconductor incoming feasibility (ie. the dependencies, name and version). I think that this is because it waits for the connection to time out, as no response is given. When I run the devtools::check(cran=FALSE) directly it runs significantly faster.

I could have sworn that there was a way to turn off the check as CRAN feature, which would disable these checks, but I can not find where that option is. Is it possible to disable the --as-cran? If so how?


You can set the following environment variables to false to turn off the incoming checks. The first turns off all incoming checks, the second only turns off those checks which use remote resources (i.e. the internet). The latter is only available on relatively new versions of R.




It doesn’t seem like there is a way to pass arguments to devtools::check() when run from the build pane other than the args argument (so it doesn’t seem possible to run with cran = FALSE for instance except on the R command line.

I would suggest you open an issue at requesting this feature


Thanks Jim. Will do. Trying the other as a workaround.


I put


into my ~/.R/check.Renviron file. However, this does not fix the problem. I think because Rstudio/devtools is also passing --no-environ in the check call that the check.Renviron files is not being read in, and thus the environment variable is not being set.


Does Tools > Project Options > Build Tools have --as-cran in the Check Package field?


There is both a leading and trailing underscore in _R_CHECK_CRAN_INCOMING_, you are missing the trailing underscore. With it the environment variables are found and used in ~/.R/check.Renviron.


For easier reference to follow this topic, an issue has been opened