download.packages(pkgs, destdir, available = NULL, repos = getOption("repos"), contriburl = contrib.url(repos, type), method, type = getOption("pkgType"), ...)available.packages
listing packages available at the repositories, or NULL which
makes an internal call to available.packages.
"https://cran.r-project.org" or its Statlib mirror,
"http://lib.stat.cmu.edu/R/CRAN".
repos.
download.file.
install.packages.
download.file.
download.packages takes a list of package names and a
destination directory, downloads the newest versions and saves them in
destdir. If the list of available packages is not given as
argument, it is obtained from repositories. If a repository is local,
i.e.\ifelse{latex}{\out{~}}{ } the URL starts with "file:", then the packages are not
downloaded but used directly. Both "file:" and
"file:///" are allowed as prefixes to a file path. Use the
latter only for URLs: see url for their interpretation.
(Other forms of file:// URLs are not supported.)
available.packages, contrib.url. The main use is by install.packages.
See download.file for how to handle proxies and
other options to monitor file transfers.
The R Installation and Administration manual for how to set up a repository.