| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/refresh.R |
| 3 |
\name{refresh} |
| 4 |
\alias{refresh} |
| 5 |
\title{Refresh the local cache of available packages} |
| 6 |
\usage{ |
| 7 |
refresh() |
| 8 |
} |
| 9 |
\value{ |
| 10 |
A list of package databases, invisibly -- one for each repository |
| 11 |
currently active in the \R session. Note that this function is normally |
| 12 |
called for its side effects. |
| 13 |
} |
| 14 |
\description{ |
| 15 |
Query the active R package repositories for available packages, and |
| 16 |
update the in-memory cache of those packages. |
| 17 |
} |
| 18 |
\details{ |
| 19 |
Note that \R also maintains its own on-disk cache of available packages, |
| 20 |
which is used by \code{available.packages()}. Calling \code{refresh()} will force |
| 21 |
an update of both types of caches. renv prefers using an in-memory |
| 22 |
cache as on occasion the temporary directory can be slow to access (e.g. |
| 23 |
when it is a mounted network filesystem). |
| 24 |
} |
| 25 |
\examples{ |
| 26 |
\dontrun{ |
| 27 |
|
| 28 |
# check available packages |
| 29 |
db <- available.packages() |
| 30 |
|
| 31 |
# wait some time (suppose packages are uploaded / changed in this time) |
| 32 |
Sys.sleep(5) |
| 33 |
|
| 34 |
# refresh the local available packages database |
| 35 |
# (the old locally cached db will be removed) |
| 36 |
db <- renv::refresh() |
| 37 |
|
| 38 |
} |
| 39 |
} |