I’d also recommend recategorizing this question into Package Development (I think package-builders will be able to help you out, and might miss this post in the IDE category, as it’s usually targeted at the IDE devs). You won’t lose anything. The thread stays the same. All you need to do is hit the pencil icon next to the post title, and then you can use the dropdown to select a different category. (I have access because I’m an admin, but I’ll leave the decision up to you!
A couple other options that might be worth exploring, to complement @mara’s suggestions:
You could define your own commands + keyboard shortcuts for executing the requisite code, using an RStudio addin. See https://rstudio.github.io/rstudioaddins/ for some documentation as to how that could be accomplished.
One thing that’s not clear to me is when you would like make to be invoked – is this something that needs to be done at build time for the package (when a source tarball is prepared)? Or before installing the package / preparing a binary build?
Haven’t thought about that - will look into it, as it sounds interesting and useful.
This doesn’t work for me, as I am mis-using the package structure - see below.
I am (mis)using the package structure to do reproducible research and to make the archiving, sharing and versioning easier (on github).
I am using the R folder for function definitions, data for input data, and R notebooks stored is inst/Reports for doing the import, processing, analysis, and graphing of the results. E.g, one import notebook imports data, processes ot and writes it into the data folder, so that when I load the package again via devtools::load_all() the new data is loaded.
So the idea is not that much install it, but to use it with devtools to do analysis.
Following that, I am using Makefiles to automate the knitting of the reports, i.e. importing and processing the data, creating graphs, … So it has nothing to do with the actual building of the package (which is done in the usual R way), but with the actual analysis.
Well - it not only effects package development, but rather how one can customize the build functions - at the moment it seems that I can only switch between different build targets. It would be nice, if one could define a keyboard shortcut to execute a script easily, which is effectively what I would like to do (invoking make).
Following the RStudio addin suggestion - can I call make in the same way that that the build tool “Makefile” is doing it, i.e. with the viewer of the output in the top-right? This would be the perfect solution.