p_inst | R Documentation |
p_inst
is a wrapper around install.packages
. It tries
hard to select the most appropriate lib
and stops in case of conflict.
Use install.packages
if any additional argument is needed.
p_inst_batsh
writes one executable file .sh
(Linux, macOS) or
two files .bat, .R
(Windows) that allow a delayed installation of old
packages in a R –vanilla environment. This is useful if the default configuration
of R defined in R/etc/Rprofile.site
launchs additional packages with
compiled code, since these packages cannot be updated without modifying the
R/etc/Rprofile.site
file.
p_oldpkgs
is a wrapper around old.packages
.
For the three above functions, if crandb
loaded in .GlobalEnv
,
then the packages are sorted by their increasing number of dependencies.
...
allows a non-standard evaluation of unquoted packages separated by commas.
p_inst(..., char = NULL, lib = NULL, repos = getOption("repos")[1],
contriburl = NULL, dependencies = NA, type = getOption("pkgType"))
p_oldpkgs(type = "both", lib.loc = .libPaths()[1],
repos = getOption("repos")[1])
p_inst_batsh(..., char = NULL, type = "binary", verbose = TRUE,
dir = ".", lib = .libPaths()[1], repos = getOption("repos")[1])
... |
any format recognized by |
char |
(name to) a character vector or a list. Use this argument if
|
lib |
character. The directory where to install the packages, usually
one of the directories listed by |
repos |
character. The address of your local CRAN. |
contriburl |
character. The address of your private repository. |
dependencies |
logical. |
type |
character. Either |
lib.loc |
character. The directory where to search for old packages. |
verbose |
Logical. Print information of the download process. |
dir |
character. The directory where to write the files |
tmpdir <- tempdir()
pkgs <- p_oldpkgs(type = "source", repos = "https://cloud.r-project.org")
pkgs <- c("brew","fs","XML","RWsearch")
p_inst_batsh(pkgs, type = "source", dir = tmpdir, repos = "https://cloud.r-project.org")
if (.Platform$OS.type == "windows") {
unlink(file.path(tmpdir, "installrpkgs.R"))
unlink(file.path(tmpdir, "installrpkgs.bat"))
} else unlink(file.path(tmpdir, "installrpkgs.sh"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.