Assuming the R session is started within the same directory that the
project lives, that call should be able to restore successfully.
Alternatively, you can pass the project directory to the
`packrat::restore()` call, and that should be sufficient to rebuild
the project's private library (assuming it can find the
`packrat/packrat.lock` file)
You might instead want to use `packrat::init(project = "...")`, to
ensure the associated `.Rprofile` is also automagically generated (so
that R sessions started in that directory automatically use Packrat;
but note that this won't be the case if you launch R with e.g. `R
--vanilla`).
If you want to start an R session (shiny application) for a
packrat-powered project, you'll need to either:
1. Start the R session from the project directory with the
autoloader in the `.Rprofile` available, or
2. Start the R session, call `packrat::on(<projectDir>)`, and then
launch the application, or
3. Simply start R with the appropriate library path set on the
command line, e.g. `R_LIBS_USER=<privatePackratLibrary> R` -- assuming
you've already asked packrat to rebuild the private library with
`packrat::restore()`.
Hope this helps,
Kevin
On Wed, Mar 25, 2015 at 1:55 PM, Andrew Stewart