Automate configuration options for github install with renv

315 views Asked by At

I am trying to include a development version package in a project with renv. However the package requires the following install options

install_github("james-thorson/VAST", INSTALL_opts="--no-staged-install")

I see in the renv documentation that it is possible to supply configuration options to the install

https://rstudio.github.io/renv/reference/install.html#package-configuration

But I'm unclear how and where to include this option so that it is reproducible by other users

  1. How exactly would I pass the --no-staged-install to renv within an renv environment
configure.args = c(VAST = "install_opts=--no-staged-install")
options(configure.args = configure.args)
renv::install("james-thorson/VAST")

doesn't seem to work, neither does

options(install.opts = "--no-staged-install")
renv::install("james-thorson/VAST")
  1. Where would I then put those instructions so that when new users try and restore the repo the VAST install instructions are followed? In the .Rprofile file?
1

There are 1 answers

2
Kevin Ushey On BEST ANSWER

renv uses an option called install.opts for this case. From ?renv::install:

Similarly, additional flags that should be passed to R CMD INSTALL can be set via the install.opts R option:

# installation of R packages using the Windows Subsystem for Linux
# may require the `--no-lock` flag to be set during install
options(install.opts = "--no-lock")
renv::install("xml2")

In this case, I believe you can set:

options(install.opts = "--no-staged-install")
renv::install("james-thorson/VAST")