CRAN Task Views: Installing/Updating/Downloading Packages

Share:

Description

Client-side tools for installing CRAN task views.

Usage

1
2
3
4
5
6
7
8
9
available.views(repos = NULL, ...)
install.views(views, coreOnly = FALSE, repos = NULL, ...)
update.views(views, coreOnly = FALSE, repos = NULL, lib.loc = NULL, filters = NULL, ...)
download.views(views, destdir, coreOnly = FALSE, repos = NULL, ...)

## S3 method for class 'ctv'
print(x, packagelist = TRUE, ...)
## S3 method for class 'ctvlist'
print(x, packagelist = FALSE, ...)

Arguments

views

character vector with the short names of the task views whose associated packages should be downloaded and installed. Alternatively, views can also be an object of class "ctvlist" (as returned by available.views) or an object of class "ctv" (i.e., an element of a "ctvlist").

coreOnly

logical. Should all packages or only core packages be installed? (recycled to the same length as views)

repos

character, the base URL of the repository. By default getOption("repos") is tried and otherwise getOption("CRAN") is used.

lib.loc

character vector describing the location of R library trees to search through (and update packages therein).

filters

a character vector or list to filter available.packages, e.g., for filtering with respect to operating system type or free and open-source software license.

destdir

directory where downloaded packages are to be stored.

...

further arguments passed to install.packages or download.packages respectively.

x

an object of class "ctv" or "ctvlist" respectively.

packagelist

logical. Should the packagelist also be printed?

Details

install.views queries the file ‘Views.rds’ located at the ‘src/contrib’ directory of ‘repos’ and then simply calls install.packages to install the packages associated with the view specified. For each view it can be specified whether all packages or only the core packages should be installed.

available.views returns the names of the task views currently available in the file ‘Views.rds’. In earlier versions, this was called CRAN.views (which still works and provides the same functionality).

update.views queries which packages from a view are not yet installed (using installed.packages) and which of the installed packages are older than the packages available (using available.packages). It subsequently installs only the packages that are not current or not installed yet.

download.views works exactly as install.views except that it download.packages instead of install.packages.

For a more detailed description of the arguments see also install.packages.

Value

available.views returns an object of class "ctvlist" of the available task views whose elements are of class "ctv".

install.views and update.views have no return value.

References

Zeileis A (2005). CRAN Task Views. R News, 5(1), 39–40. https://CRAN.R-project.org/doc/Rnews/.

See Also

install.packages

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
  ## query names of CRAN task views available
  available.views()
  
  ## install Econometrics view
  install.views("Econometrics")
  ## only with core packages
  install.views("Econometrics", coreOnly = TRUE)

  ## update Econometrics view
  update.views("Econometrics")

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.