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

Automate configuration options for github install with renv

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

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

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

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

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

  1. 我如何在 renv 环境中将 --no-staged-install 传递给 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:

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

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

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