Rbuildignore and Excluding Directories

前端 未结 4 2171
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 04:12

I am interested in excluding two directories inst\\docs and inst\\examples while building and installing the package. I know that an easy way out i

相关标签:
4条回答
  • 2020-12-06 04:23

    This appears to be an issue with RStudio. Using install from the devtools package seems to cause the folders to be ignored. Building and installing directly from the command line also seems to cause the folders to be ignored. The 'Build & Reload' button in RStudio, however, seems to not take into account the .Rbuildignore for those folders.

    0 讨论(0)
  • 2020-12-06 04:27

    An old post but it still seems to be an issue when building binary packages. The following hack seems to work though (i.e., build source package and then build binary from that source package).

    f <- devtools::build("mypackage")
    system(paste0("R CMD INSTALL --build ", f))
    
    0 讨论(0)
  • 2020-12-06 04:35

    Just to update, as of the latest versions, devtools::use_build_ignore has been moved to:

    usethis::use_build_ignore(c("yourfolder1", "yourfolder2", "yourfile"))
    
    0 讨论(0)
  • 2020-12-06 04:44

    You can do

    devtools::use_build_ignore(c("yourfolder1", "yourfolder2", "yourfile"))
    
    0 讨论(0)
提交回复
热议问题