init
works as follows:- Application dependencies are computed by examining theRcode
throughout the project for
library
andrequire
calls. - A snapshot is taken of the version of each package currently used by
the project as described in
snapshot
, and each package's
sources are downloaded. - A private library is created in the directory.
- The snapshot is applied to the directory as described in
restore
.
When init
is finished, all the packages
on which the project depends are installed in a new, private library located
inside the project directory.You must restart your Rsession in the given project directory after
running init
in order for the changes to take effect!
When Ris started in the directory, it will use the new, private library.
Calls to require
and library
will load packages
from the private library (except for 'base' or 'recommended' Rpackages,
which are found in the system library), and functions such as install.packages
will modify that private library. You can sync this private library with
packrat using snapshot
and restore
.