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
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.
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))
Just to update, as of the latest versions, devtools::use_build_ignore
has been moved to:
usethis::use_build_ignore(c("yourfolder1", "yourfolder2", "yourfile"))
You can do
devtools::use_build_ignore(c("yourfolder1", "yourfolder2", "yourfile"))