Hi Matthew,
We currently don't have a well-paved road for accomplishing this, but here are some ideas...
You could handle this by explicitly calling `packrat::on()` yourself, e.g. from each sub-directory:
packrat::on("../")
We could also update the implementation of `packrat::on()` so that, when called from a sub-directory, it automatically crawls upwards looking for the packrat folder, e.g.
packrat::on() ## looks for directory (current or parent) containing 'packrat/packrat.lock' file
You could also add `.Rprofile`s to each subdirectory, with something like:
owd <- setwd("../")
source("packrat/init.R")
setwd(owd)
It's also possible that we could control this with an environment variable, e.g. R_PACKRAT_PROJECT_ROOT, which could be easily set from a Makefile or other context. We don't do this currently but it doesn't seem like a bad idea...
Let me know if this steers you in the right direction, or if you have any thoughts on what you think would be the best solution here.
Kevin