getPkgVers {reposTools}R Documentation

Information for an installed package

Description

These functions retrieve information on installed packages, including whether or not a package is installed.

Usage

is.installed(pkg, vers=NULL, verbose=TRUE, oper="==", libs)
getPkgVers(pkg, libs = reposToolsLibPaths(), verbose=TRUE)

Arguments

pkg The package to check
vers The version of the package. NULL implies any version
libs A R library directory (or vector of directories).
verbose Extra diagnostics
oper Allows for a version test instead of a direct '=='

Value

is.installed: This function will return a logical representing if the specified package is installed or not. The version parameter defaults to NULL, which implies any version of the package. If a version is specified, it can be either as a string or as a VersionNumber object. If the former, it will be coerced to the latter. Argument oper can be any comparitive function (>, <, !=, etc), but defaults to ==. This is the comparator applied to see if a package of a given version is installed.
getPkgVers: This function returns a list containing all version numbers of any instance of the package being isntalled. If the package is installed only in one occassion, it will be a single element list. If the package is installed multiple times, each instance will have a corresponding version number. Likewise, an empty list is returned if the package is not installed. The VersionNumber class is used for the return value.

Author(s)

Jeff Gentry

See Also

VersionNumber, reposToolsLibPaths

Examples

  lib <- paste(.find.package("reposTools"),"data/",sep="/")
  getPkgVers("reposTools",lib)

[Package reposTools version 1.8.0 Index]