[R-pkg-devel] .gitkeep file to prevent folder from erasing when empty

Luck Buttered luckbuttered at gmail.com
Mon Oct 3 07:03:33 CEST 2016


Hello everyone:

I am working on a vignette for a package that outputs reports for users. As
part of the vignette, users can manually run eval=FALSE code that creates
example reports. These example reports that they create can be saved to an
output folder within extdata (extdata/OutputFolder).

When I submit to CRAN, I will be sure that OutputFolder is empty. However,
whenever I make it empty, the entire folder disappears. To combat this
problem, I have placed a .gitkeep file within the OutputFolder.

I *believe* the presence of the .gitkeep file works as intended (prevents
the automatic removal of the OutputFolder when empty). However, upon
running check(), I receive a note:

*checking for hidden files and directories ... NOTE*
*Found the following hidden files and directories:*
*  inst/extdata/OutputFiles/.gitkeep*
*These were most likely included in error. See section ‘Package*
*structure’ in the ‘Writing R Extensions’ manual.*

Does anyone have advice on how to effectively remove this note? Otherwise,
does my rationale above seem like a reasonable purpose for keeping the note?

Thank you for helping me approach this!

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list