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

R语言:writePACKAGES()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-17 09:48:14 | 显示全部楼层 |阅读模式
writePACKAGES(tools)
writePACKAGES()所属R语言包:tools

                                        Generate PACKAGES files
                                         生成的文件包

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

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

Generate "PACKAGES" and "PACKAGES.gz" files for a repository of source or Mac/Windows binary packages.
产生“PACKAGES和PACKAGES.gz文件源或Mac / Windows二进制的包库。


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


write_PACKAGES(dir = ".", fields = NULL,
               type = c("source", "mac.binary", "win.binary"),
               verbose = FALSE, unpacked = FALSE, subdirs = FALSE,
               latestOnly = TRUE, addFiles = FALSE)



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

参数:dir
Character vector describing the location of the repository (directory including source or binary packages) to generate the "PACKAGES" and "PACKAGES.gz" files from and write them to.  
特征向量描述库的位置(包括源代码或二进制包的目录),以产生PACKAGES和PACKAGES.gz文件,并将其写入。


参数:fields
a character vector giving the fields to be used in the "PACKAGES" and "PACKAGES.gz" files in addition to the default ones, or NULL (default).  The default corresponds to the fields needed by available.packages: "Package", "Version", "Priority", "Depends", "Imports", "LinkingTo", "Suggests", "Enhances", "OS_type", "License" and "Archs", and those fields will always be included, plus the file name in field "File" if addFile = TRUE and the path to the subdirectory in field "Path" if subdirectories are used.  
要使用的领域中一个字符向量PACKAGES和PACKAGES.gz文件,除了默认的,或者NULL(默认)。默认对应到所需要的领域:available.packages"Package","Version","Priority","Depends","Imports","LinkingTo" "Suggests","Enhances","OS_type","License"和"Archs",这些领域将永远被列入,再加上在该领域的文件名"File"如果addFile = TRUE和在该领域的子目录的路径"Path"如果使用子目录。


参数:type
Type of packages: currently source ".tar.gz" archives, and Mac or Windows binary (".tgz" or ".zip", respectively) packages are supported.  Defaults to "win.binary" on Windows and to "source" otherwise.  
包的类型:目前源.tar.gz.tgz档案,Mac或Windows的二进制(或.zip),分别包支持。默认为"win.binary"在Windows和"source"否则。


参数:verbose
logical.  Should packages be listed as they are processed?
逻辑。包应该被列为他们处理?


参数:unpacked
a logical indicating whether the package contents are available in unpacked form or not (default).
逻辑说明是否包内容解压形式或(默认)。


参数:subdirs
either logical (to indicate if subdirectories should be included, recursively) or a character vector of name of subdirectories to include.
无论是逻辑(表示如果子目录应包括递归)或子目录的名称,包括一个特征向量。


参数:latestOnly
logical: if multiple versions of a package are available should only the latest version be included?
逻辑:如果一个包的多个版本,只有最新版本列入?


参数:addFiles
logical: should the filenames be included as field File in the "PACKAGES" file.
逻辑:应场FilePACKAGES文件中包含的文件名。


Details

详情----------Details----------

write_PACKAGES scans the named directory for R packages, extracts information from each package's "DESCRIPTION" file, and writes this information into the "PACKAGES" and "PACKAGES.gz" files.
write_PACKAGESR包扫描指定目录,提取信息,从每个包的DESCRIPTION文件,这个信息写入PACKAGES和<X >文件。

Including non-latest versions of packages is only useful if they have less constraining version requirements, so for example latestOnly = FALSE could be used for a source repository when foo_1.0 depends on R >= 2.10.0 but foo_0.9 is available which depends on R >= 2.7.0.
包不包括最新版本是唯一有用的,如果他们有较少限制的版本要求,例如latestOnly = FALSE可用于源库foo_1.0R >= 2.10.0但是<X >是可foo_0.9的依赖。

Support for repositories with subdirectories and hence for subdirs != FALSE was added in R 2.7.0: this depends on recording a "Path" field in the "PACKAGES" file.
与子目录,因此资料库的支持subdirs != FALSE增加了在R 2.7.0:这取决于记录在"Path"文件PACKAGES场。

Support for more general file names (e.g. other types of compression) via a "File" field in the "PACKAGES" file was added in R 2.10.0 and can be used by download.packages.  If the file names are not of the standard form, use addFiles = TRUE.
更一般的文件名通过"File"领域(如压缩其他类型)PACKAGES文件中添加了支持R 2.10.0和可以使用download.packages 。如果文件名是不标准的形式,使用addFiles = TRUE。

type = "win.binary" uses unz connections to read all "DESCRIPTION" files contained in the (zipped) binary packages for Windows in the given directory dir, and builds files "PACKAGES" and "PACKAGES.gz" files from this information.
type = "win.binary"使用unz连接读取所有DESCRIPTION在用于Windows的(zipped)在给定的目录dir二进制包中包含的文件,并建立档案“ PACKAGES和PACKAGES.gz从这个信息的文件。


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

Invisibly returns the number of packages described in the resulting "PACKAGES" and "PACKAGES.gz" files.  If 0, no packages were found and no files were written.
无形返回由此产生的PACKAGES和PACKAGES.gz文件中所描述的包的数量。如果0,没有包被发现,并没有文件被写入。


注意----------Note----------

Processing ".tar.gz" archives to extract the "DESCRIPTION" files is quite slow.
处理.tar.gz档案提取DESCRIPTION文件,是相当缓慢的。

This function can be useful on other OSes to prepare a repository to be accessed by Windows machines, so type = "win.binary" should work on all OSes.
此功能可以在其他操作系统中是有用的准备一个Windows机器访问的库,所以type = "win.binary"应该在所有的操作系统工作。


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



Uwe Ligges and R-core.




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

See read.dcf and write.dcf for reading "DESCRIPTION" files and writing the "PACKAGES" and "PACKAGES.gz" files.
read.dcf和write.dcf阅读DESCRIPTION文件和写PACKAGES,PACKAGES.gz文件。


举例----------Examples----------


## Not run: [#无法运行:]
write_PACKAGES("c:/myFolder/myRepository")  # on Windows[在Windows]
write_PACKAGES("/pub/RWin/bin/windows/contrib/2.9",
               type="win.binary")  # on Linux[在Linux]


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 04:10 , Processed in 0.032281 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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