rstudio“安装和重新启动”不忽略.rbuildignore中的文件

发布于 2025-02-10 12:25:09 字数 526 浏览 8 评论 0原文

我的.rbuildignore指定了以下文件:

^inst/extdata$

这是一个目录,该目录容纳了我使用的一些.csv文件。

当我使用“安装和重新启动”按钮构建软件包时,这些文件夹包含在构建软件包中,如:

> list.files(system.file(package = 'myPackage'), recursive = T, full.names = T)

...         
 [6] "C:/Users/JohnDoe/R/win-library/4.0/myPackage/extdata/df.csv"
...

如果我使用命令devtools :: install()inst/extdata文件夹在构建过程中正确忽略了。这使我相信差异在于“安装和重新启动”按钮。有什么方法可以将此按钮映射到devtools :: install()命令?

My .Rbuildignore specifies these files:

^inst/extdata$

This is a directory that holds some .csv files I use.

When I build my package with the "Install and Restart" button, these folders are included in the built package as demonstrated by:

> list.files(system.file(package = 'myPackage'), recursive = T, full.names = T)

...         
 [6] "C:/Users/JohnDoe/R/win-library/4.0/myPackage/extdata/df.csv"
...

However, if I build my package with the command devtools::install(), the inst/extdata folder is correctly ignored in the build process. This leads me to believe the discrepancy lies in the "Install and Restart" button. Is there any way to map this button to the devtools::install() command?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我要还你自由 2025-02-17 12:25:09

.rbuildignorer cmd build命令使用。如果您直接从目录中安装而无需构建TARBALL,则不会使用。对于基本r cmd install以及rstudio仿真都是如此。

因此,您应该做的是将文件放置在其他未由r cmd install处理的地方,例如在目录ignoreme中,而不是名称的名称,其名称为“安装”我”。

如果您不想这样做,那么可以将任意r命令附加到Rstudio中的键,但这是很多工作。请参阅 http://rstudio.github.io/rstudioaddins/ 如果您想要详细信息。

.Rbuildignore is used by the R CMD build command. If you install directly from a directory without building a tarball, it's not used. This is true for base R CMD INSTALL as well as the RStudio emulations of it.

So what you should do is to put the files somewhere else that isn't handled by R CMD INSTALL, for example in directory ignoreMe instead of a directory whose name means "install me".

If you don't want to do that, then it is possible to attach arbitrary R commands to keys in RStudio, but that's a lot of work. See http://rstudio.github.io/rstudioaddins/ if you want the details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文