r-使用renv自动配置github安装选项



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

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

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

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

但我不清楚如何以及在哪里包括这个选项,以便其他用户可以复制

  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. 然后我将把这些说明放在哪里,以便当新用户尝试恢复repo时,遵循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")

最新更新