使用renv自动执行github安装的配置选项

问题描述

我正在尝试在带有renv的项目中包含开发版本包。但是,该软件包需要以下安装选项

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

我在renv文档中看到可以为安装提供配置选项

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

但是我不清楚如何以及在何处包含此选项,以便其他用户可以重现

  1. 我如何将--no-staged-install传递到renv环境中的renv
configure.args = c(VAST = "install_opts=--no-staged-install")
options(configure.args = configure.args)
renv::install("james-thorson/VAST")

似乎无效,

options(install.opts = "--no-staged-install")
renv::install("james-thorson/VAST")
  1. 然后将这些说明放在哪里,以便新用户尝试还原存储库时,遵循VAST安装说明?在.Rprofile文件中?

解决方法

renv在这种情况下使用名为install.opts的选项。来自?renv::install

类似地,应该传递给R CMD INSTALL的其他标志可以 可以通过install.opts R选项设置:

# 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")

在这种情况下,我相信您可以设置:

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