
restore(project = NULL, overwrite.dirty = FALSE, prompt = interactive(), dry.run = FALSE, restart = !dry.run)
NULL
,
then the directory associated with the current packrat project is used. Otherwise,
the project directory specified is used.restore
will put you in the exact state
represented by the snapshot being applied, use overwrite.dirty = TRUE
.TRUE
to prompt before performing potentially destructive
changes (package removals or downgrades); FALSE
to perform these
operations without confirmation.TRUE
, compute the changes to your packrat state that
would be made if a restore was performed, without actually executing them.TRUE
, restart the R session after restoring.restore
works by adding, removing, and changing packages so that the
set of installed packages and their versions matches the snapshot exactly.There are three common use cases for restore
:
restore
after copying a project to a new
machine to populate the library on that machine.
restore
to apply library changes made by a
collaborator to your own library. (In general, you want to run restore
whenever you pick up a change to packrat.lock
)
restore
to undo accidental changes made
to the library since the last snapshot.
restore
cannot make changes to packages that are currently loaded. If
changes are necessary to currently loaded packages, you will need to restart
R to apply the changes (restore
will let you know when this is
necessary). It is recommended that you do this as soon as possible, because
any library changes made between running restore
and restarting R will
be lost.
snapshot
, the command that creates the snapshots applied with
restore
.status
to view the differences between the most recent snapshot
and the library.