download.packages
Download Packages from a Repository

Description

Downloads packages from an on-line or a local repository to a specified destination directory.

Usage

download.packages(pkgs, destdir, available = NULL,
                  repos = getOption("repos"),
                  contriburl = contrib.url(repos, type), method,
                  type = getOption("pkgType"), ...) 

Arguments

pkgs a character vector to indicate the names of packages to download and install. These packages can be source or binary packages.
destdir a character vector to indicate where downloaded packages are stored.
available an object that is the result of "available.packages". If 'NULL', calls available.packages.
repos a character vector containing the base URL of the repositories. Can refer to local files.
contriburl the URL(s) of the contrib sections of the repositories. The contrib sections hold packages that are not part of the core.
method this argument is ignored.
type a character vector to indicate the type of package to download and install. Possible values are "source", "mac.binary", "mac.binary.leopard", "win.binary" and "win64.binary".
... additional arguments to pass to this funciton.

Details

This function downloads the newest packages specified in pkgs and saves them in the folder destdir.
The repositories from which you download packages can be located either on a server or on your local computer.
Value
returns a matrix with two columns. One column contains the names of the packages that are successfully downloaded. The other column contains the local file names of corresponding packages.
Note
This function is used by install.packages, which downloads and installs packages. download.packages is useful for getting a source package so you can examine and change its source code. The downloaded package is in an archive format, such as a compressed tar file (for source packages) or a zip file (for Windows binary packages).
See Also
install.packages, available.packages, contrib.url
Examples

## Not run: dir.create(tdir <- file.path(tempdir(), "packages")) download.packages("zoo", tdir) dir(tdir) unlink(tdir, recursive=TRUE) # delete temporary directory ## End(Not run)

Package utils version 6.1.4-13
Package Index