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

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

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

                                        Read R's NEWS file or a similar one
                                         阅读R的新闻文件或类似的一个

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

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

Read/check R's "NEWS" file or a similarly formatted one. This was an experimental feature added in R 2.4.0: as from R 2.12.0 the preferred format is "NEWS.Rd".
读/检查R的NEWS文件或类似的格式之一。这是一个实验性的功能,增加在R 2.4.0:从R 2.12.0首选的格式是NEWS.Rd。


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


readNEWS(file = file.path(R.home(), "NEWS"), trace = FALSE,
         chop = c("first", "1", "par1", "keepAll"))
checkNEWS(file = file.path(R.home(), "NEWS"))



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

参数:file
the name of the file which the data are to be read from. Alternatively, file can be a connection, which will be opened if necessary, and can also be a complete URL.  For more details, see the file argument of read.table.
是被读出的数据文件的名称。另外,file可以是一个的connection,这将被打开,如果有必要,也可以是一个完整的URL。有关详细信息,请参阅fileread.table参数。


参数:trace
logical indicating if the recursive reading should be traced, i.e., print what it is doing.
逻辑表示如果递归的读数,即应追溯到打印它在做什么。


参数:chop
a character string specifying how the news entries should be chopped; chop = "keepAll" saves the full entries.
字符串指定新闻条目应如何被砍伤; chop = "keepAll"保存完整的项目。


Details

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

readNEWS() reads a pre-R-2.12.0-style "NEWS" file; checkNEWS() checks for common errors in formatting.  Currently it detects an incorrect number of spaces before the "o" item marker.
readNEWS()读取前 -  R-2.12.0风格NEWS文件,“格式中的常见错误checkNEWS()检查。目前,它检测到"o"项标记前的空格的数目不正确。

If non-ASCII characters are needed, the "NEWS" file may be encoded in UTF-8 with a byte-order mark (BOM) at the beginning, which readNEWS() will recognize.  Other encodings will display incorrectly on some systems.  However, BOMs are discouraged on many systems and not all editors recognize them, so "NEWS" files should normally be written in ASCII.
如果需要非ASCII字符,NEWS文件可能会被编码为UTF-8字节顺序标记(BOM)开始,这readNEWS()将承认。其他编码会在某些系统上无法正确显示。然而,材料明细表是劝阻在许多系统上,并非所有的编辑都承认他们,所以NEWS文件通常应被写入ASCII中。


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

readNEWS() returns an (S3) object of class "newsTree"; effectively a list of lists which is a tree of NEWS entries.
readNEWS()返回一个类的对象(三)"newsTree";有效list名单,这是一个新闻条目的树。

checkNEWS() returns TRUE if no suspected errors are found, or prints a message for each suspected error and returns FALSE.
checkNEWS()回报TRUE如果没有发现可疑的错误,或打印出每一个可疑的错误的消息,并返回FALSE。

Note that this was only ever experimental and may be removed soon, since the NEWS-file format is not longer supported (but there are examples "ONEWS", "OONEWS" and perhaps in packages).
请注意,这是只有不断实验,并可能很快被删除,因为新闻文件格式不再支持(但也有例子“ONEWS,OONEWS,也许在包)。


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


NEWStr  <- readNEWS(trace = TRUE)# chop = "first" ( = "first non-empty")[CHOP =“第一”(“第一个非空”)]
## keep the full NEWS entry text i.e. "no chopping":[#保持完整的新闻条目的文本,即“没有砍”:]
NEWStrA <- readNEWS(chop = "keepAll")
object.size(NEWStr)
object.size(NEWStrA) ## (no chopping) ==&gt; about double the size[#(斩波)==>约一倍的大小]

str(NEWStr, max.level = 3)

str(NEWStr[[c("2.3", "2.3.1")]], max.level=2, vec.len=1)

NEWStr [[c("2.3", "2.3.1", "NEW FEATURES")]]
NEWStrA[[c("2.4", "2.4.0", "NEW FEATURES")]]

# Check the current NEWS file[检查当前的新闻文件]

stopifnot(checkNEWS())


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-22 21:40 , Processed in 0.023108 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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