You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/checkpoint.R
+26-6Lines changed: 26 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,19 @@
13
13
#' \itemize{
14
14
#' \item{Create a new local snapshot library to install packages. By default this library folder is at \code{~/.checkpoint}} but you can modify the path using the \code{checkpointLocation} argument.
15
15
#' \item{Update the options for your CRAN mirror and point to an MRAN snapshot using \code{\link[base]{options}(repos)}}
16
-
#' \item{Scan your project folder for all required packages and install them from the snapshot using \code{\link[utils]{install.packages}}}
16
+
#' \item{Scan your project folder for all required packages and install them from the snapshot using \code{\link[utils]{install.packages}()}}
17
17
#' }
18
18
#'
19
19
#' @section Resetting the checkpoint:
20
20
#' To reset the checkpoint, simply restart your R session.
21
+
#'
22
+
#' @section Changing the default MRAN url:
23
+
#'
24
+
#' \code{checkpoint} uses https by default to download packages (see \link{https://www.r-consortium.org/news/blogs/2015/08/best-practices-using-r-securely}).
25
+
#' \code{checkpoint} Defaults to \link{https://mran.revolutionanalytics.com/snapshot} by default in R versions 3.2.0 and later, if https support is enabled.
26
+
#'
27
+
#' You can modify the default URL. To change the URL, use \code{options(checkpoint.mranUrl = ...)}
28
+
#'
21
29
#'
22
30
#' @param snapshotDate Date of snapshot to use in \code{YYYY-MM-DD} format,e.g. \code{"2014-09-17"}. Specify a date on or after \code{"2014-09-17"}. MRAN takes one snapshot per day.
23
31
#'
@@ -29,12 +37,22 @@
29
37
#'
30
38
#' @param checkpointLocation File path where the checkpoint library is stored. Default is \code{"~/"}, i.e. the user's home directory. A use case for changing this is to create a checkpoint library on a portable drive (e.g. USB drive).
31
39
#'
32
-
#' @param use.knitr If TRUE, uses parses all \code{Rmarkdown} files using the \code{knitr} package.
40
+
#' @param use.knitr If TRUE, parses all \code{Rmarkdown} files using the \code{knitr} package.
41
+
#'
42
+
#' @param auto.install.knitr If TRUE and the project contains rmarkdown files, then automatically included the packages \code{knitr} and \code{rmarkdown} in packages to install.
43
+
#'
44
+
#' @param scan.rnw.with.knitr If TRUE, uses \code{\link[knitr]{knit}} to parse \code{.Rnw} files, otherwise use \code{\link[utils]{Sweave}}
33
45
#'
34
46
#' @param verbose If TRUE, displays progress messages.
35
47
#'
36
48
#'
37
-
#' @return NULL. See the \code{Details} section for side effects.
49
+
#' @return Checkpoint is called for its side-effects (see the details section), but invisibly returns a list with elements:
\item{use.knitr}{If TRUE, uses parses all \code{Rmarkdown} files using the \code{knitr} package.}
25
+
\item{use.knitr}{If TRUE, parses all \code{Rmarkdown} files using the \code{knitr} package.}
26
+
27
+
\item{auto.install.knitr}{If TRUE and the project contains rmarkdown files, then automatically included the packages \code{knitr} and \code{rmarkdown} in packages to install.}
28
+
29
+
\item{scan.rnw.with.knitr}{If TRUE, uses \code{\link[knitr]{knit}} to parse \code{.Rnw} files, otherwise use \code{\link[utils]{Sweave}}}
25
30
}
26
31
\value{
27
-
NULL. See the \code{Details} section for side effects.
32
+
Checkpoint is called for its side-effects (see the details section), but invisibly returns a list with elements:
33
+
\itemize{
34
+
\item{files_not_scanned}
35
+
\item{pkgs_found}
36
+
\item{pkgs_not_on_mran}
37
+
\item{pkgs_installed}
38
+
}
28
39
}
29
40
\description{
30
41
Together, the checkpoint package and the checkpoint server act as a CRAN time machine. The \code{checkpoint()} function installs the packages referenced in the specified project to a local library exactly as they existed at the specified point in time. Only those packages are available to your session, thereby avoiding any package updates that came later and may have altered your results. In this way, anyone using the checkpoint \code{checkpoint()} function can ensure the reproducibility of your scripts or projects at any time.
@@ -41,14 +52,23 @@ Specifically, the function will:
41
52
\itemize{
42
53
\item{Create a new local snapshot library to install packages. By default this library folder is at \code{~/.checkpoint}} but you can modify the path using the \code{checkpointLocation} argument.
43
54
\item{Update the options for your CRAN mirror and point to an MRAN snapshot using \code{\link[base]{options}(repos)}}
44
-
\item{Scan your project folder for all required packages and install them from the snapshot using \code{\link[utils]{install.packages}}}
55
+
\item{Scan your project folder for all required packages and install them from the snapshot using \code{\link[utils]{install.packages}()}}
45
56
}
46
57
}
47
58
48
59
\section{Resetting the checkpoint}{
49
60
50
61
To reset the checkpoint, simply restart your R session.
51
62
}
63
+
64
+
\section{Changing the default MRAN url}{
65
+
66
+
67
+
\code{checkpoint} uses https by default to download packages (see \link{https://www.r-consortium.org/news/blogs/2015/08/best-practices-using-r-securely}).
68
+
\code{checkpoint} Defaults to \link{https://mran.revolutionanalytics.com/snapshot} by default in R versions 3.2.0 and later, if https support is enabled.
69
+
70
+
You can modify the default URL. To change the URL, use \code{options(checkpoint.mranUrl = ...)}
0 commit comments