Snakemake:执行 R 脚本时忽略 Rprofile

fak*_*hek 4 r snakemake

我在 Snakemake 工作流程中执行 R 脚本时遇到一些问题。看来我的个人 .Rprofile 已加载到 R 脚本中。该作业在奇点容器内运行,问题是我自动加载 R 配置文件中的一些未安装在容器中的包。我当然可以通过编辑我的 R 配置文件来解决这个问题,但是其他想要使用管道的人都必须做同样的事情,这是我不喜欢的。有人知道如何解决这个问题吗?

谢谢!

hrb*_*str 5

你会发现Rscript:

$ Rscript
Usage: /path/to/Rscript [--options] [-e expr [-e expr2 ...] | file] [args]

--options accepted are
  --no-environ        Don't read the site and user environment files
  --no-site-file      Don't read the site-wide Rprofile
  --no-init-file      Don't read the user R profile
  --vanilla           Combine --no-save, --no-restore, --no-site-file
                        --no-init-file and --no-environ
Run Code Online (Sandbox Code Playgroud)

并R有一些选项可以帮助您解决此问题:

$ R --help

Usage: R [options] [< infile] [> outfile]
   or: R CMD command [arguments]

Start R, a system for statistical computation and graphics, with the
specified options, or invoke an R tool via the 'R CMD' interface.

Options:
  --no-environ          Don't read the site and user environment files
  --no-site-file        Don't read the site-wide Rprofile
  --no-init-file        Don't read the user R profile
  --vanilla   Combine --no-save, --no-restore, --no-site-file,
      --no-init-file and --no-environ
Run Code Online (Sandbox Code Playgroud)

(为简洁起见,省略了其他选项)