| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/upgrade.R |
| 3 |
\name{upgrade} |
| 4 |
\alias{upgrade} |
| 5 |
\title{Upgrade renv} |
| 6 |
\usage{ |
| 7 |
upgrade(project = NULL, version = NULL, reload = NULL, prompt = interactive()) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{project}{The project directory. If \code{NULL}, then the active project will |
| 11 |
be used. If no project is currently active, then the current working |
| 12 |
directory is used instead.} |
| 13 |
|
| 14 |
\item{version}{The version of renv to be installed. |
| 15 |
|
| 16 |
When \code{NULL} (the default), the latest version of renv will be installed as |
| 17 |
available from CRAN (or whatever active package repositories are active) |
| 18 |
Alternatively, you can install the latest development version with |
| 19 |
\code{"main"}, or a specific commit with a SHA, e.g. \code{"5049cef8a"}.} |
| 20 |
|
| 21 |
\item{reload}{Boolean; reload renv after install? When \code{NULL} (the |
| 22 |
default), renv will be re-loaded only if updating renv for the |
| 23 |
active project. Since it's not possible to guarantee a clean reload |
| 24 |
in the current session, this will attempt to restart your R session.} |
| 25 |
|
| 26 |
\item{prompt}{Boolean; prompt upgrade before proceeding?} |
| 27 |
} |
| 28 |
\value{ |
| 29 |
A boolean value, indicating whether the requested version of |
| 30 |
renv was successfully installed. Note that this function is normally |
| 31 |
called for its side effects. |
| 32 |
} |
| 33 |
\description{ |
| 34 |
Upgrade the version of renv associated with a project, including using |
| 35 |
a development version from GitHub. Automatically snapshots the updated |
| 36 |
renv, updates the activate script, and restarts R. |
| 37 |
|
| 38 |
If you want to update all packages (including renv) to their latest CRAN |
| 39 |
versions, use \code{\link[=update]{update()}}. |
| 40 |
} |
| 41 |
\section{Note}{ |
| 42 |
\code{upgrade()} is expected to work for renv versions >= 1.0.1. |
| 43 |
To upgrade from prior versions of renv, users should |
| 44 |
|
| 45 |
\code{renv::deactivate();} |
| 46 |
\code{install.packages("renv");} |
| 47 |
\code{renv::activate();} |
| 48 |
\code{renv::record("renv")} |
| 49 |
} |
| 50 |
|
| 51 |
\examples{ |
| 52 |
\dontrun{ |
| 53 |
|
| 54 |
# upgrade to the latest version of renv |
| 55 |
renv::upgrade() |
| 56 |
|
| 57 |
# upgrade to the latest version of renv on GitHub (development version) |
| 58 |
renv::upgrade(version = "main") |
| 59 |
|
| 60 |
} |
| 61 |
} |