找回密码
 注册
查看: 319|回复: 0

R语言 sos包 PackageSum2()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 12:01:25 | 显示全部楼层 |阅读模式
PackageSum2(sos)
PackageSum2()所属R语言包:sos

                                         Add Info from Installed Packages to PackageSummary
                                         信息从已安装的软件包PackageSummary

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Add information on installed packages to the PackageSummary of a findFn object.
新增的PackageSummaryfindFn对象上安装的软件包的信息。


用法----------Usage----------


PackageSum2(x,
        fields=c("Title", "Version", "Author", "Maintainer", "Packaged",
                 'helpPages', 'vignette'), lib.loc=NULL, ...)
## S3 method for class 'findFn'
PackageSum2(x,
        fields=c("Title", "Version", "Author", "Maintainer", "Packaged",
                 'helpPages', 'vignette'), lib.loc=NULL, ...)
## S3 method for class 'data.frame'
PackageSum2(x,
        fields=c("Title", "Version", "Author", "Maintainer", "Packaged",
                 'helpPages', 'vignette'), lib.loc=NULL, ...)
## S3 method for class 'list'
PackageSum2(x,
        fields=c("Title", "Version", "Author", "Maintainer", "Packaged",
                 'helpPages', 'vignette'), lib.loc=NULL, ...)



参数----------Arguments----------

参数:x
a data.frame with columns Package and Score.  
数据框的列Package和Score。


参数:fields
character vector of names of columns to add to x.  The function first looks  in the components of packageDescription(x$Package[i]).  'vignette' is obtained via the function of that name.  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.  
字符向量的列名添加到x。该函数首先查找的组成部分packageDescription(x$Package[i])。 “小插曲”,通过该名称的功能。组件“打包”收到特殊处理。如果存在,只有部分前面的“;”将被保留。这似乎是由类似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 findFn, extract the PackageSummary attribute and pass it to the data.frame method.
类的一个对象findFn,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 findFn object, add other columns from attributes of packageDescription for installed packages named in the column Package.  Also, for any packages that are installed, replace the Date with the Packaged date.  The Date in Baron's RSiteSearch database is the date of acquisition, which will typically be more recent than the Packaged date provided the locally installed package has the same version as that in Baron's database.  To get the best information from PackageSum2, it is wise to first run both installPackages to ensure that the packages of greatest interest are installed locally and update.packages() to make sure you have the latest versions installed locally.  Similarly, if PackageSum2 does not contain complete interest on a package of interest, this can be fixed by installing the package and rerunning PackageSum2.
一个data.frame这是不是一个findFn对象,添加其他列attributespackageDescription安装的软件包在列Package命名。此外,对于任何已安装的软件包,取代Date与Packaged日。 Date在男爵的RSiteSearch数据库中收购之日起,它通常会比Packaged日提供的本地安装包的版本相同在男爵的数据库中。为了获得最佳的信息PackageSum2,明智的做法是先同时运行,以确保最大的利益大包小包的本地安装和installPackages,以确保你安装了最新版本的update.packages()在本地。同样,如果PackageSum2不包含完整的利息包的兴趣,这可以固定安装相应的软件包并重新运行PackageSum2。


值----------Value----------

a data.frame with additional fields columns appended to a package summary data.frame.
额外的fields列追加到一个包的摘要数据框数据框。


(作者)----------Author(s)----------


Spencer Graves



参见----------See Also----------

findFn PackageSummary installPackages
findFnPackageSummaryinstallPackages


实例----------Examples----------


##[#]
## data.frame method[#数据框的方法]
##[#]
tstdf <- data.frame(Package=c('grid', 'base'), stringsAsFactors=FALSE)
tst2 <- PackageSum2(tstdf)

##[#]
## list method[#列表的方法]
##[#]
tstList <- list(PackageSummary=tstdf)

all.equal(tst2, PackageSum2(tstList))


##[#]
## findFn method[#findFn方法]
##[#]
tst.findFn <- data.frame(Package=c('grid', 'base')[c(1,1,2)], Score=2:4,
                    Date=LETTERS[1:3], stringsAsFactors=FALSE)
attr(tst.findFn, 'PackageSummary') <- PackageSummary(tst.findFn)
class(tst.findFn) <- c('findFn', 'data.frame')
tst2. <- PackageSum2(tst.findFn)


all.equal(tst2[, 1:7], tst2.[names(tst2)][, 1:7])



转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-9 18:45 , Processed in 0.024304 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表