diff --git a/R/retrieve.R b/R/retrieve.R index 20b11166b..659220719 100644 --- a/R/retrieve.R +++ b/R/retrieve.R @@ -29,6 +29,18 @@ the$repos_archive <- new.env(parent = emptyenv()) #' those packages were downloaded. #' #' @export +#' +#' @examples +#' \dontrun{ +#' +#' # retrieve package + versions as defined in the lockfile +#' # normally used as a pre-flight step to renv::restore() +#' renv::retrieve() +#' +#' # download one or more packages locally +#' renv::retrieve("rlang", destdir = ".") +#' +#' } retrieve <- function(packages = NULL, ..., lockfile = NULL, diff --git a/man/retrieve.Rd b/man/retrieve.Rd index 0bdfa27c0..c403f0682 100644 --- a/man/retrieve.Rd +++ b/man/retrieve.Rd @@ -39,3 +39,15 @@ before later invoking \code{\link[=restore]{restore()}}. Packages will be downlo to a directory within the \code{renv} "root" folder -- see \link{paths} for more details. } +\examples{ +\dontrun{ + +# retrieve package + versions as defined in the lockfile +# normally used as a pre-flight step to renv::restore() +renv::retrieve() + +# download one or more packages locally +renv::retrieve("rlang", destdir = ".") + +} +}