| p_vers | R Documentation |
The information displayed by p_vers depends on the availability of
crandb and binarydb in .GlobalEnv.
If crandb is not loaded in .GlobalEnv, p_vers returns a
data.frame with two columns: first column nsloaded (TRUE/FALSE) detects
(with base::isNamespaceLoaded) if the package namespaces are loaded.
Second column version is the version number of the installed packages.
If crandb is loaded in .GlobalEnv, three columns are added.
Column crandb displays the version number of the source packages recorded
in the crandb file. Column gcc displays the nedd for a compilation.
Column compare compares this version number with the version installed
on the computer. Possible values are:
-2 for a package not installed on the computer (NA) but available in crandb ;
-1 for an installed package older than the source package available in CRAN ;
0 for an installed package with the same version number than CRAN ;
+1 for a more recent package than the one available in CRAN ;
+2 for a package installed on the computer and not available in CRAN (NA) ;
+3 for a package not installed on the computer (NA) and not available in CRAN (NA).
If binarydb is loaded in .GlobalEnv, two or three columns are added.
Column binary displays the version number of the binary packages recorded
in the binarydb = available.packages, type = "binary") matrix.
Column difvb compares the installed version on the computer with this
binary version and column difbc compares (if crandb is in .GlobalEnv)
the binary version with the source package available in CRAN (which can differ
for recently updated packages, a matter of 1 to 3 days).
The numbering is identical to the one used for crandb.
If ndeps = TRUE, two more columns are added with the number
of recursive dependencies per package. Column tdeps includes the base
and recommended packages. Column ndeps does not count them. This option
can take some time. Set it to FALSE if you need speed.
p_vers_deps calculates the same information but includes the recursive
dependencies. Subsetting by "compare < 0" returns a shorter data.frame
with the uninstalled (-2) and the outdated (-1) packages. Packages marked with
nsloaded = TRUE must be detached and unloaded before any reinstallation.
Using this instruction before running install.packages or p_inst
is very useful as it detects packages that are locked and cannot be reinstalled.
The order provided by p_vers_deps is the best one for the reinstallation
of outdated packages.
p_vers(..., char = NULL, ndeps = TRUE, split = FALSE, reserved = "")
p_vers_deps(..., char = NULL, ndeps = TRUE, subset = "compare < 4",
crandb = get("crandb", envir = .GlobalEnv))
... |
any format recognized by |
char |
(name to) a character vector. Use this argument if |
ndeps |
logical. Calculate the number of recursive dependencies.
|
split |
logical. Split the output in a list of data.frame with packages allocated in at most 6 sections : library, reserved, nsloaded, cran, source, binary. |
reserved |
character. The packages in the reserved section. |
subset |
character. Subset the output data.frame on some columns.
The default |
crandb |
data.frame |
pkgs <- cnsc(RWsearch, MASS, Matrix, NotAPkg, R)
p_vers(pkgs)
## Now with crandb and binarydb loaded in .GlobalEnv. In real life, use:
## crandb_down() ; binarydb_down()
crandb_load(system.file("data", "zcrandb.rda", package = "RWsearch"))
binarydb_load(system.file("data", "zbinarydb.rda", package = "RWsearch"))
p_vers(pkgs)
p_vers(p_deps(pkgs))
p_vers_deps(pkgs) # Dependencies can be visualized with p_graphF(pkgs)
p_vers(char=c(p_depsrec(RWsearch)$RWsearch, "RWsearch"), split = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.