PackageSum2(RSiteSearch)
PackageSum2()所属R语言包:RSiteSearch
Add Info from Installed Packages to PackageSummary
信息从已安装的软件包PackageSummary
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Add information on installed packages to the PackageSummary of an RSiteSearch object.
新增的PackageSummary的RSiteSearch对象上安装的软件包的信息。
用法----------Usage----------
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer", "Packaged"),
lib.loc=NULL, ...)
## S3 method for class 'RSiteSearch':
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer", "Packaged"),
lib.loc=NULL, ...)
## S3 method for class 'data.frame':
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer", "Packaged"),
lib.loc=NULL, ...)
## S3 method for class 'list':
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer", "Packaged"),
lib.loc=NULL, ...)
参数----------Arguments----------
参数:x
a data.frame with columns Package and Score.
数据框的列Package和Score。
参数:fields
character vector of names to look for in components of packageDescription(x$Package[i]) and return as additional columns of x if found.
packageDescription(x$Package[i])和回报作为附加列在组件的名称查找的字符向量x:如果发现。
Component 'Packaged' receives special treatment. If present, only the portion preceding ';' will be retained. This seems to be a time stamp automatically generated by something like R CMD build. It is absent for packages automatically loaded when R is started. In such cases, the third component of strsplit( packageDescription( x$Package[i])$Built, ..., ';') will be stored as 'Packaged'. This seems to be a time stamp automatically generated by something like R CMD INSTALL --build.
组件“打包”收到特殊处理。如果存在,只有部分前面的“;”将被保留。这似乎是由类似R CMD build自动生成一个时间戳。这是缺席R时开始自动加载的程序包。在这种情况下,strsplit( packageDescription( x$Package[i])$Built, ..., ';')的第三个组成部分将被储存为“包装”。这似乎是由类似R CMD INSTALL --build自动生成一个时间戳。
参数:lib.loc
an optional lib.loc argument passed to packageDescription.
一个可选的lib.loc参数传递给packageDescription。
参数:...
additional arguments (currently unused)
额外的参数(目前未使用)
Details
详细信息----------Details----------
With an object of class RSiteSearch, extract the PackageSummary attribute and pass it to the data.frame method.
类的一个对象RSiteSearch,PackageSummary属性提取,并把它传递给data.frame方法。
With an object of class list, extract the PackageSummary component and pass it to the data.frame method.
类的一个对象list中,提取PackageSummary成分,并把它传递给data.frame方法。
For a data.frame that is not an RSiteSearch object, add other columns from attributes of packageDescription for installed packages named in the column Package.
一个data.frame这是不是一个RSiteSearch对象,添加其他列attributespackageDescription安装的软件包在列Package命名。
值----------Value----------
a data.frame with additional fields columns appended to x.
额外的fields列追加到数据框x。
(作者)----------Author(s)----------
Spencer Graves
参见----------See Also----------
RSiteSearch.function PackageSummary
RSiteSearch.functionPackageSummary
实例----------Examples----------
##[#]
## data.frame method[#数据框的方法]
##[#]
tstdf <- data.frame(Package=c('fda', 'base'), stringsAsFactors=FALSE)
tst2 <- PackageSum2(tstdf)
##[#]
## list method[#列表的方法]
##[#]
tstList <- list(PackageSummary=tstdf)
all.equal(tst2, PackageSum2(tstList))
##[#]
## RSiteSearch method[#RSiteSearch方法]
##[#]
tstRSearch <- data.frame(Package=c('fda', 'base')[c(1,1,2)], Score=2:4,
Date=LETTERS[1:3], stringsAsFactors=FALSE)
attr(tstRSearch, 'PackageSummary') <- PackageSummary(tstRSearch)
class(tstRSearch) <- c('RSiteSearch', 'data.frame')
tst2. <- PackageSum2(tstRSearch)
# row names are different from tst2, so fix ...[行名称不同TST2的,所以修复...]
row.names(tst2.) <- row.names(tst2)
all.equal(tst2, tst2.[names(tst2)])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|