YConnector-class(Streamer)
YConnector-class()所属R语言包:Streamer
Class "YConnector"
类“YConnector”
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The YConnector Consumer-class can be used to combine the output of multiple stream's together. The output records of the stream's are combined using a user supplied function (fun) passed to the constructor of the YConnector class. The output of the YConnector can then be used to feed a Consumer-class connected down-stream to it.
YConnectorConsumer级可以使用多个stream的输出相结合。输出记录stream的使用用户提供的功能相结合(fun)传递YConnector类的构造。的YConnector输出可以用于,养活级连接下游Consumer。
The YConnector can be connector to other Producer and Consumer objects using the connect function.
YConnector可以连接到其他Producer人和Consumer使用connect函数的对象。
用法----------Usage----------
YConnector(fun, ..., yieldSize=1e6, verbose=FALSE)
参数----------Arguments----------
参数:fun
A function that is used to combine the output of the streams connected up-stream to the YConnector. The function fun takes named arguments. The names correspond to the names of the objects passed to the connect function used to connect the YConnector to up-stream Streamer classes.
一个function,用于组合连接上游到YConnector的流输出。功能fun命名参数。名称传递给对象的名称相对应的connect函数用于连接YConnector上游Streamer类。
参数:...
Additional arguments. Currently not used
额外的参数。目前未使用
参数:verbose
logical(1) indicating whether class methods should report to the user.
logical(1)类的方法是否应该报告给用户。
参数:yieldSize
The number of records the input parser is to yield.
输入分析器的记录数是屈服。
方法----------Methods----------
Methods defined on this class include:
在这个类中定义的方法包括:
show signature(object = "YConnector"): Displays the names of the up-stream components to which the YConnector-class has been
显示signature(object = "YConnector"):显示,YConnector级一直上游组件的名称
构造----------Constructors----------
Use YConnector to construct instances of this class.
使用YConnector建设这个类的实例。
领域----------Fields----------
.fun: User defined function to combine the output of several streams. The function is applied on the named outputs obtained by calling the yield method on the named streams connected upstream to
.fun:用户自定义function结合几个流的输出。该功能适用于上游连接到名为流通过调用yield方法获得命名的产出
.upstream: A named list of objects connected up-stream to the YConnector-class. This field is meant to be internal to the class and is only modified by using the connect function to
.upstream:一个名为list对象连接起来流YConnector级。这个领域是内部类只使用connect函数修改
方法----------Methods----------
initialize(..., fun): A method to initialize the fields of the
initialize(..., fun):一个方法来初始化的字段
yield(): Yields the records obtained by applying the function fun to the result obtained by calling yield on all the
yield():产生通过功能fun调用yield对所有获得的结果获得的记录
作者(S)----------Author(s)----------
Nishant Gopalakrishnan <a href="ngopalak@fhcrc.org">ngopalak@fhcrc.org</a>
参见----------See Also----------
stream,TConnector, connect
stream,TConnector,connect
举例----------Examples----------
fl <- system.file("extdata", "s_1_sequence.txt", package="Streamer")
#### Blocks for stream1 [###块的stream1]
b1 <- RawInput(fl, 100L, reader=rawReaderFactory(1e4))
c1 <- RawToChar(10L)
#### Blocks for stream2[###块STREAM2]
b2 <- RawInput(fl, 100L, reader=rawReaderFactory(1e4))
c2 <- RawToChar(20L)
#### YConnector with function list for combining the blocks[##YConnector的与功能相结合的块列表]
y <- YConnector(fun=list)
blocks <- structure(list(b1,c1, b2, c2, y),
names = c("b1", "c1", "b2", "c2","y"))
df <- data.frame(from =c("b1", "b2", "c1", "c2"), to = c("c1", "c2", "y", "y"))
#### Connect the blocks using the connect function[###连接使用连接功能块]
res <- connect(blocks, df)
y
#### Yield data from the y connector[###从Y型连接器的产量数据]
yield(res$y)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|