Non-standard Remotes package INLA in R package

I have a package that Imports INLA, which is not hosted on CRAN or a standard GitHub repository. There are multiple SO questions detailing how to install the package on a personal machine, such as this, or even mentions it as a dependency in a package.

The two ways that are typically recommended to install on a personal machine are:

Direct from INLA website

install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)

From the GitHub host

devtools::install_github(repo = "https://github.com/hrue/r-inla", ref = "stable", subdir = "rinla", build = FALSE)

Now, these are fine for personal machines, but don't work in the DESCRIPTION files Remotes: section.

If we do url::https://inla.r-inla-download.org/R/stable, this gives an error that the file extension isn't recognized.

 Error: Error: Failed to install 'unknown package' from URL:
  Don't know how to decompress files with extension 

If we do github::hrue/r-inla, I am unaware of how to pass (or if it's even possible) the ref, subdir, and build arguments in the DESCRIPTION file.

Previous packages used a read only mirror of the INLA code that was hosted on GitHub, solely for this purpose, at this repo and then just using github::inbo/INLA. However, this repository is out of date.

Current solution

What I'm doing instead is to directly reference the tarball hosted on the main webpage.

url::https://inla.r-inla-download.org/R/stable/src/contrib/INLA_21.02.23.tar.gz

This solution works, and passes CI as well as the machines are able to install and load from there. The only issue is that I need to periodically update the static link to this tarball, and would prefer to reference the stable build, either directly from the INLA website as above, or the hrue/inla repo with those other arguments passed. Is there a way to achieve this in the DESCRIPTION file?

1 Like

:wave: @caldwellst! Now that's an interesting riddle to which I do not have a complete solution but wanted to share my notes. :sweat_smile:

  • Regarding the remotes package, in DESCRIPTION one can indicate the ref and subdir (Remotes: hrue/r-inla/rinla@stable) but not other arguments.
    I.e. I created a small package with
Imports:
  INLA
Remotes:
  hrue/r-inla/rinla@stable

in DESCRIPTION. remotes::install_deps() failed, remotes::install_deps(build = FALSE) worked.

  • I started wondering whether it'd help to use R-universe, but I don't think it'd be better than the solution in one of the SO posts you shared, where one has to indicate which repo to use. :thinking:

Might I ask why you want all installation metadata to be in DESCRIPTION, by the way?

This topic was automatically closed after 45 days. 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.