Issue with installing non-CRAN dependencies (INLA)

Hi! I'm building a package which I have tried to submit to CRAN, which depends on the package R-INLA, which is not on CRAN. Thanks to some previous threads here (Correctly installing non-CRAN dependencies - #4 by BobOHara and Running vignette with non-CRAN dependencies) I thought I knew how to do this, but unfortunately there was an error when running the Debian checks, that the package INLA cannot be found. Here is the log: https://win-builder.r-project.org/incoming_pretest/inlamemi_1.0.0_20240613_155626/Debian/00check.log (please ignore the other issues pointed out there).
In trying to reproduce this error, I have tried using both R-Hub and R CMD Check through Github Actions, and I seem to be getting similar issues there, though the error messages do not match exactly. The results of those can be seen here: Workflow runs · emmaSkarstein/inlamemi · GitHub

Based on the error message I get for Ubuntu oldrel-1 on R CMD Check through Github Actions, it seems like it may be related to the Matrix package, so I tried adding a dependency on Matrix in the Description file, but that didn't change anything.

I thought it would be enough to add the Additional_repositories field in the description file, but it seems like that isn't the case, and I am really struggling to identify what is causing the problem here. Does anyone have similar experiences or have any ideas for what I can try?

In short, you cannot use a non-CRAN (or Bioconductor) package on CRAN. You can add it in Suggests, with Additional_repositories, but you still cannot:

  • run examples that use this package on CRAN,
  • run tests that use this package on CRAN,
  • run vignettes that use this package on CRAN.

To work around these, you may look at

  • @examplesIf if you are using roxygen2 for manual pages,
  • skip_on_cran() to skip test cases that need this package, on CRAN,
  • pre-building the vignette, so CRAN machines do not run the vignette code.
1 Like

Thank you so much, I can't believe I missed this, somehow I though CRAN would be downloading through the Additional_repositories link, but I realize that isn't the case :sweat_smile: Once I know what to look for now I see how other packages using INLA have done these things too. It makes much more sense now, thank you very much for your reply!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.