Statistics, Science, Random Ramblings

A blog about data and other interesting things

Ignoring files in inst

Posted at — Feb 7, 2020

I am currently working on a shiny application to track runs (it is usable as of now, but expect an alpha version if you decide to do so, I’ll write something on the application on this site when it has more polish). Part of the application is a configuration file, with two default locations: the directory the application is run from and a location under ~/.config.

Looking in the working directory of the app first gives flexibility for development. You can conveniently place a config for development in your repository and not have to worry about messing with your data. Of course you don’t want to include the development configuration when building the package, so you add it to .Rbuildignore, right? Well no. The structure of the package contains the actual application application in inst, and it turns out that .Rbuildignore does not apply to the inst directory.

Thankfully, #rstats Twitter came to the rescue and I was pointed to .Rinstignore which can be used to specify files you do not want to include in the package that live under inst.