is_package_current: Is the installed version of a package current?

Description Usage Arguments Value See Also Examples

View source: R/is-current.R

Description

Checks to see if the installed version of a package is current.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
assert_is_package_current(...)

assert_all_are_current_packages(
  x,
  lib.loc = .libPaths(),
  repos = getOption("repos"),
  type = getOption("pkgType"),
  severity = getOption("assertive.severity", "stop")
)

assert_any_are_current_packages(
  x,
  lib.loc = .libPaths(),
  repos = getOption("repos"),
  type = getOption("pkgType"),
  severity = getOption("assertive.severity", "stop")
)

is_package_current(
  x = NULL,
  lib.loc = .libPaths(),
  repos = getOption("repos"),
  type = getOption("pkgType"),
  .xname = get_name_in_parent(x)
)

Arguments

...

Passed to and from deprecated assert_is_current_package.

x

A character vector of package names, or NULL to check all installed packages.

lib.loc

A character vector of paths to local package libraries.

repos

A character vector of URLs to repositories to check for new package versions.

type

Check the repository for source or binary packages?

severity

How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".

.xname

Not intended to be used directly.

Value

is_package_current returns a logical vector that is TRUE whenever the package version matches the one in the repository. NA is returned for non-installed packages. The assert_* functions throw an error in the event of failure.

See Also

old.packages, on which this is based, which has advanced usage features.

Examples

1
2
3
# This test is marked "dont-test" since it involves a connection to 
# repositories which is potentially long running.
is_package_current(c("assertive.base", "assertive.reflection", "NONEXISTENTPKG"))

assertive.reflection documentation built on July 31, 2020, 1:06 a.m.