EVOLUTION-MANAGER
Edit File: available.packages.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: List Available Packages at CRAN-like Repositories</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for available.packages {utils}"><tr><td>available.packages {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>List Available Packages at CRAN-like Repositories</h2> <h3>Description</h3> <p><code>available.packages</code> returns a matrix of details corresponding to packages currently available at one or more repositories. The current list of packages is downloaded over the internet (or copied from a local mirror). </p> <h3>Usage</h3> <pre> available.packages(contriburl = contrib.url(repos, type), method, fields = NULL, type = getOption("pkgType"), filters = NULL, repos = getOption("repos"), ignore_repo_cache = FALSE, max_repo_cache_age, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>contriburl</code></td> <td> <p>URL(s) of the ‘<span class="file">contrib</span>’ sections of the repositories. Specify this argument only if your repository mirror is incomplete, e.g., because you burned only the ‘<span class="file">contrib</span>’ section on a CD. </p> </td></tr> <tr valign="top"><td><code>method</code></td> <td> <p>download method, see <code><a href="download.file.html">download.file</a></code>. </p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p>character string, indicate which type of packages: see <code><a href="install.packages.html">install.packages</a></code>. </p> <p>If <code>type = "both"</code> this will use the source repository. </p> </td></tr> <tr valign="top"><td><code>fields</code></td> <td> <p>a character vector giving the fields to extract from the ‘<span class="file">PACKAGES</span>’ file(s) in addition to the default ones, or <code>NULL</code> (default). Unavailable fields result in <code>NA</code> values. </p> </td></tr> <tr valign="top"><td><code>filters</code></td> <td> <p>a character vector or list or <code>NULL</code> (default). See ‘Details’. </p> </td></tr> <tr valign="top"><td><code>repos</code></td> <td> <p>character vector, the base URL(s) of the repositories to use. </p> </td></tr> <tr valign="top"><td><code>ignore_repo_cache</code></td> <td> <p>logical. If true, the repository cache is never used (see ‘Details’). </p> </td></tr> <tr valign="top"><td><code>max_repo_cache_age</code></td> <td> <p>any cached values older than this in seconds will be ignored. See ‘Details’. </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>allow additional arguments to be passed from callers (which might be arguments to future versions of this function). </p> </td></tr> </table> <h3>Details</h3> <p>The list of packages is either copied from a local mirror (specified by a <span class="samp">file://</span> URI) or downloaded. If downloaded and <code>ignore_repo_cache</code> is false (the default), the list is cached for the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> session in a per-repository file in <code><a href="../../base/html/tempfile.html">tempdir</a>()</code> with a name like </p> <pre>repos_http%3a%2f%2fcran.r-project.org%2fsrc%2fcontrib.rds</pre> <p>The cached values are renewed when found to be too old, with the age limit controlled <em>via</em> argument <code>max_repo_cache_age</code>. This defaults to the current value of the environment variable <span class="env">R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE</span>, or if unset, to <code>3600</code> (one hour). </p> <p>By default, the return value includes only packages whose version and OS requirements are met by the running version of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>, and only gives information on the latest versions of packages. </p> <p>Argument <code>filters</code> can be used to select which of the packages on the repositories are reported. It is called with its default value (<code>NULL</code>) by functions such as <code>install.packages</code>: this value corresponds to <code><a href="../../base/html/options.html">getOption</a>("available_packages_filters")</code> and to <code>c("R_version", "OS_type", "subarch", "duplicates")</code> if that is unset or set to <code>NULL</code>. </p> <p>The built-in filters are </p> <dl> <dt><code>"R_version"</code></dt><dd><p>Exclude packages whose <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> version requirements are not met.</p> </dd> <dt><code>"OS_type"</code></dt><dd><p>Exclude packages whose OS requirement is incompatible with this version of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>: that is exclude Windows-only packages on a Unix-alike platform and <em>vice versa</em>.</p> </dd> <dt><code>"subarch"</code></dt><dd><p>For binary packages, exclude those with compiled code that is not available for the current sub-architecture, e.g. exclude packages only compiled for 32-bit Windows on a 64-bit Windows <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>.</p> </dd> <dt><code>"duplicates"</code></dt><dd><p>Only report the latest version where more than one version is available, and only report the first-named repository (in <code>contriburl</code>) with the latest version if that is in more than one repository.</p> </dd> <dt><code>"license/FOSS"</code></dt><dd><p>Include only packages for which installation can proceed solely based on packages which can be verified as Free or Open Source Software (FOSS, e.g., <a href="https://en.wikipedia.org/wiki/FOSS">https://en.wikipedia.org/wiki/FOSS</a>) employing the available license specifications. Thus both the package and any packages that it depends on to load need to be <em>known to be</em> FOSS. </p> <p>Note that this does depend on the repository supplying license information. </p> </dd> <dt><code>"license/restricts_use"</code></dt><dd><p>Include only packages for which installation can proceed solely based on packages which are known not to restrict use. </p> </dd> <dt><code>"CRAN"</code></dt><dd><p>Use CRAN versions in preference to versions from other repositories (even if these have a higher version number). This needs to be applied <em>before</em> the default <code>"duplicates"</code> filter, so cannot be used with <code>add = TRUE</code>. </p> </dd> </dl> <p>If all the filters are from this set, then they can be specified as a character vector; otherwise <code>filters</code> should be a list with elements which are character strings, user-defined functions or <code>add = TRUE</code> (see below). </p> <p>User-defined filters are functions which take a single argument, a matrix of the form returned by <code>available.packages</code>, and return a matrix consisting of a subset of the rows of the argument. </p> <p>The special ‘filter’ <code>add = TRUE</code> appends the other elements of the filter list to the default filters. </p> <h3>Value</h3> <p>A matrix with one row per package, row names the package names and column names including <code>"Package"</code>, <code>"Version"</code>, <code>"Priority"</code>, <code>"Depends"</code>, <code>"Imports"</code>, <code>"LinkingTo"</code>, <code>"Suggests"</code>, <code>"Enhances"</code>, <code>"File"</code> and <code>"Repository"</code>. Additional columns can be specified using the <code>fields</code> argument. </p> <p>Where provided by the repository, fields <code>"OS_type"</code>, <code>"License"</code>, <code>"License_is_FOSS"</code>, <code>"License_restricts_use"</code>, <code>"Archs"</code>, <code>"MD5sum"</code> and <code>"NeedsCompilation"</code> are reported for use by the filters and package management tools, including <code><a href="install.packages.html">install.packages</a></code>. </p> <h3>See Also</h3> <p><code><a href="install.packages.html">install.packages</a></code>, <code><a href="download.packages.html">download.packages</a></code>, <code><a href="contrib.url.html">contrib.url</a></code>. </p> <p>The ‘R Installation and Administration’ manual for how to set up a repository. </p> <h3>Examples</h3> <pre>## Not run: ## Restrict install.packages() (etc) to known-to-be-FOSS packages options(available_packages_filters = c("R_version", "OS_type", "subarch", "duplicates", "license/FOSS")) ## or options(available_packages_filters = list(add = TRUE, "license/FOSS")) ## Give priority to released versions on CRAN, rather than development ## versions on Omegahat, R-Forge etc. options(available_packages_filters = c("R_version", "OS_type", "subarch", "CRAN", "duplicates")) ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>