File: snapshot.Rd

package info (click to toggle)
r-cran-packrat 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,900 kB
  • sloc: sh: 51; makefile: 5
file content (78 lines) | stat: -rw-r--r-- 2,735 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/snapshot.R
\name{snapshot}
\alias{snapshot}
\title{Capture and store the packages and versions in use}
\usage{
snapshot(
  project = NULL,
  available = NULL,
  lib.loc = libDir(project),
  ignore.stale = FALSE,
  dry.run = FALSE,
  prompt = interactive(),
  snapshot.sources = TRUE,
  infer.dependencies = TRUE
)
}
\arguments{
\item{project}{The project directory. Defaults to current working
directory.}

\item{available}{A database of available packages.}

\item{lib.loc}{The library to snapshot. Defaults to the private library
associated with the given directory.}

\item{ignore.stale}{Stale packages are packages that are different from the
last snapshot, but were installed by packrat. Typically, packages become
stale when a new snapshot is available, but you haven't applied it yet with
\code{\link{restore}}. By default, packrat will prevent you from taking a
snapshot when you have stale packages to prevent you from losing changes
from the unapplied snapshot. If your intent is to overwrite the last
snapshot without applying it, use \code{ignore.stale = TRUE} to skip this
check.}

\item{dry.run}{Computes the changes to your packrat state that would be made
if a snapshot were performed, and prints them to the console.}

\item{prompt}{\code{TRUE} to prompt before performing snapshotting package
changes that might be unintended; \code{FALSE} to perform these operations
without confirmation. Potentially unintended changes include snapshotting
packages at an older version than the last snapshot, or missing despite
being present in the last snapshot.}

\item{snapshot.sources}{Boolean; should package sources be downloaded during
snapshot?}

\item{infer.dependencies}{If \code{TRUE}, infer package dependencies by
examining \R code used within the project. This included the \R code
contained within \code{.R} files, as well as other multi-mode documents
(e.g. \code{.Rmd}).}
}
\description{
Finds the packages in use in the project, and stores a list
of those packages, their sources, and their current versions in packrat.
}
\note{
\code{snapshot} modifies the project's \code{packrat.lock} file, and
the sources stored in the project's \code{packrat/src} directory. If you
are working with a version control system, your collaborators can sync the
changes to these files and then use \code{\link{restore}} to apply your
snapshot.
}
\examples{
\dontrun{
# Take a snapshot of the current project
snapshot()

# See what changes would be included in a snapshot
snapshot(dry.run = TRUE)

}
}
\seealso{
\code{\link{restore}} to apply a snapshot.
\code{\link{status}} to view the differences between the most recent snapshot
and the library.
}