2

For my research project I want to use a make-based workflow but also deliver the project in the form of a package. Thus, I want to put reusable functions in the /R directory for others to access but also use R scripts executable from the command line to do the actual analysis (generate and clean datasets, create plots, etc.), with make tracking the relationships among files and rebuilding what is necessary.

In packages, supposedly the /exec directory is meant for executable files. I'm wondering if putting my executable scripts in this directory would be appropriate.

cgmil
  • 410
  • 2
  • 18
  • Yes ... but place the source into `inst/exec/` so that it gets installed as `exec/`. There are _numerous_ examples of doing this. – Dirk Eddelbuettel Sep 04 '18 at 17:14
  • @DirkEddelbuettel I thought `exec/` was one of those directories to avoid putting in `inst/` since it's a part of a package's structure: see ["Installed Files" from *R Packages*](http://r-pkgs.had.co.nz/inst.html). As a test I built a package that uses `exec/` and put a `.R` file in it and that structure was preserved. I would also be bothered by doing this since it seems I would need to rebuild the package and refer to a file in `exec/` in every `make` recipe when the file is actually in `inst/exec/` when I'm working with the unbuilt project. – cgmil Sep 04 '18 at 17:43

0 Answers0