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

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

[复制链接]
发表于 2012-9-30 11:24:10 | 显示全部楼层 |阅读模式
scanRepeated(SoDA)
scanRepeated()所属R语言包:SoDA

                                        Read data with multiple line patterns
                                         多行模式中读取数据

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

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

Data files may have non-identical patterns so that different lines require different what= arguments to scan().  This function takes a list of such patterns and applies them in separate calls to produce an interwoven list of the resulting data.
数据文件可能有不相同的模式,让不同的线路需要不同的what=scan()参数。此功能需要这样的模式,并将其应用于单独调用产生的交织所产生的数据列表。


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


scanRepeated(file, what, ...)



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

参数:file
The file of input data, organized so that each line can be read by a call to  scan()
的输入数据,该文件组织,使每一行可以通过调用读取scan()


参数:what
A list, whose elements are suitable as the argument of the same name to  scan().  The first element applies to the first line of the file, the second to the second line, etc.  Elements are recycled, so that if the pattern of the file repeats after k lines the list only needs to be of length k.  
一个列表,它的元素是适合作为参数相同的名称,scan()。第一元件适用于该文件的第一行,第二至第二行,等等元素被回收,因此,重复的文件,如果该图案后的k行列表仅需要长度为k。


参数:...
Additional arguments to be passed to  scan(), typically sep= and similar controls.  
其他参数传递给scan(),通常sep=和类似的控制。


Details

详细信息----------Details----------

The function operates by setting up a call to mapply to read each line of the file as a text connection. For this reason, really large files will be slow.  See the examples in the book for alternatives in R or Perl.
建立呼叫mapply读取每一行的文件为文本连接的功能。出于这个原因,非常大的文件将是缓慢的。见书的替代品在R或Perl中的例子。


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

A list, with one element per line.  When the pattern of the lines repeats, this has the data form of a matrix of type "list", with k rows.  The list can be restructured in a variety of ways, but its format is often suitable as is for computations that iterate over the sets of k line types, as in the book example.
的列表,每行有一个元素。当图案的行重复,这具有一个矩阵类"list",与k行的数据形式的。该列表可以将重组中的各种不同的方式,但它的格式通常是适合作为为计算迭代k线类型的组,作为在书的例子。


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

mapply, scan
mapply,scan


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


## Not run: [#不运行:]
what = list(
    list(abb = "", population = 1, area = 1,
         latitude = 1, longitude = 1),
    list(name = "", population = 1, area = 1)
)
data <- scanRepeated("stateCities.txt", what, sep = ",")
## End(Not run)[#(不执行)]
## produces a list of 100 elements, alternately state and city data.[#产生的100个元素的列表,交替国家和城市的数据。]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-8 20:15 , Processed in 0.034147 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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