packageDescription(utils)
packageDescription()所属R语言包:utils
Package Description
包装说明
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Parses and returns the "DESCRIPTION" file of a package.
解析和返回DESCRIPTION文件包。
用法----------Usage----------
packageDescription(pkg, lib.loc = NULL, fields = NULL,
drop = TRUE, encoding = "")
packageVersion(pkg, lib.loc = NULL)
参数----------Arguments----------
参数:pkg
a character string with the package name.
与包名称的字符串。
参数:lib.loc
a character vector of directory names of R libraries, or NULL. The default value of NULL corresponds to all libraries currently known. If the default is used, the loaded packages are searched before the libraries.
特征向量的研发图书馆的目录名,或NULL。默认值的NULL对应于目前已知的所有库。如果使用默认值,装包库前搜索。
参数:fields
a character vector giving the tags of fields to return (if other fields occur in the file they are ignored).
字符向量领域的标签返回(如果发生在他们被忽略的文件等领域)。
参数:drop
If 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".
如果TRUE长度fields1,然后各自领域的价值与单个字符串返回,而不是一个对象类"packageDescription"。
参数:encoding
If there is an 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.
如果有一个Encoding场,什么编码重新编码进行尝试?如果NA,无需重新编码。其他值iconv,所以默认的""表示当前locale的编码。
Details
详情----------Details----------
A package will not be "found" unless it has a "DESCRIPTION" file which contains a valid Version field. Different warnings are given when no package directory is found and when there is a suitable directory but no valid "DESCRIPTION" file.
包不会被“发现”,除非它有一个DESCRIPTION文件,其中包含一个有效的Version领域。没有包目录中发现,当有一个合适的目录,但没有有效的DESCRIPTION文件时,给出不同的警告。
An attached environment named to look like a package (e.g. package:utils2) will be ignored.
一个附加的环境看起来像一个包(例如package:utils2)将被忽略。
packageVersion() is a convenience shortcut, allowing things like if (packageVersion("MASS") < "7.3") { do.things } .
packageVersion()是一个方便快捷,让喜欢if (packageVersion("MASS") < "7.3") { do.things } 的东西。
值----------Value----------
If a "DESCRIPTION" file for the given package is found and can successfully be read, 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.
“DESCRIPTION给定的包文件,如果被发现,并可以成功地读取,packageDescription返回一个类的对象"packageDescription",这是一个值的命名列表()作为名称的元素和标签领域,除非drop = TRUE。
If parsing the "DESCRIPTION" file was not successful, it returns a named list of NAs with the field tags as names if fields is not null, and NA otherwise.
如果解析DESCRIPTION文件没有成功,它返回字段标签作为名字命名了NA的名单,如果fields是不是null,NA 否则。
packageVersion() returns a (length-one) object of class "package_version".
packageVersion()类"package_version"返回一个(长度)的对象。
参见----------See Also----------
read.dcf
read.dcf
举例----------Examples----------
packageDescription("stats")
packageDescription("stats", fields = c("Package", "Version"))
packageDescription("stats", fields = "Version")
packageDescription("stats", fields = "Version", drop = FALSE)
if(packageVersion("MASS") < "7.3")
message("you need to update 'MASS'")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|