packageDescription(pkg, lib.loc = NULL, fields = NULL, drop = TRUE, encoding = "")
packageVersion(pkg, lib.loc = NULL)
NULL
. The default value of NULL
corresponds to all
libraries currently known. If the default is used, the loaded
packages and namespaces are searched before the libraries.TRUE
and the length of fields
is 1, then
a single character string with the value of the respective field is
returned instead of an object of class "packageDescription"
.Encoding
field, to what encoding
should re-encoding be attempted? If NA
, no re-encoding. The
other values are as used by iconv
, so the default
""
indicates the encoding of the current locale.packageDescription
returns an object of
class "packageDescription"
, which is a named list with the
values of the (given) fields as elements and the tags as names, unless
drop = TRUE
.If parsing the DESCRIPTION file was not successful, it returns
a named list of NA
s with the field tags as names if fields
is not null, and NA
otherwise.packageVersion()
returns a (length-one) object of class
"package_version"
.
Version
field. Different warnings are
given when no package directory is found and when there is a suitable
directory but no valid DESCRIPTION file. An attached environment named to look like a package
(e.g., package:utils2
) will be ignored.
packageVersion()
is a convenience shortcut, allowing things
like if (packageVersion("MASS") < "7.3") { do.things }
.
read.dcf