getPkgVers {reposTools} | R Documentation |
These functions retrieve information on installed packages, including whether or not a package is installed.
is.installed(pkg, vers=NULL, verbose=TRUE, oper="==", libs) getPkgVers(pkg, libs = reposToolsLibPaths(), verbose=TRUE)
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 '==' |
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.
Jeff Gentry
VersionNumber
, reposToolsLibPaths
lib <- paste(.find.package("reposTools"),"data/",sep="/") getPkgVers("reposTools",lib)