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

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

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

                                        Flexible execution of R source for demonstrations
                                         灵活执行的R源的示威

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

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

R expressions in a source file are shown and evaluated sequentially, in an R “demo” session. Lines are alternately shown and evaluated when the user types empty lines to the function demoInput in another R session (the “input” session) running in the same working directory.  Any R expression typed in the input session is shown and evaluated in the demo, allowing you to add to the canned demo.
ŕ在源文件中的表达式,顺序计算,在R“演示”会议。线交替显示和评估,当用户键入空行的功能demoInput的另一个R会话(“输入”会议),运行在相同的工作目录。输入会话中键入任何R的表达和评估在演示中,允许您添加的罐头演示。


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


demoSource(demo=, inputCon,  where = .GlobalEnv)
demoInput(path=)

demoExample(name, package = "SoDA")



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

参数:demo
Either the file name or input connection for the R source to be demonstrated, or an object from class "demoSource".  The latter allows resuming a demo.  By default, a menu interface prompts the user to select an R source file in the local directory or type in a path string (see localRFiles   
无论是文件名或输入连接的R加以论证,或一个对象类"demoSource"。后者允许恢复演示。默认情况下,菜单界面提示用户在本地目录或类型选择R源文件的路径字符串中(见localRFiles


参数:inputCon
The connection from which to read prompt input.  Usually omitted in which case a call to demoInput() should occur in another R session in the same directory (see the details).
连接从阅读提示输入。通常在这种情况下,调用demoInput()省略应该发生在另一个R会话在同一目录中(查看详细信息)。


参数:where
The environment where the demo expressions should be evaluated.  By default, in the global environment.
应该被评估的环境中的演示表达式。默认情况下,在全球环境中。


参数:path
The file system path where user input is passed to the demo controller.  Must be a writable location and be known to both R sessions.  Usually omitted, in which case a suitable fifo is created to communicate with demoSource().
其中用户输入传递到演示控制器的文件系统路径。必须是可写入的位置是已知的两个R会话。一般省略,在这种情况下,合适的fifo创建通信demoSource()。


参数:name
For demoExample(), the name of the example file, with or without a ".R" suffix.  There should be a corresponding file in the "Examples" subdirectory of the package.  Once the file has been determined, demoExample just calls demoSource.  
对于demoExample(),示例文件的名称,带或不带一个".R"后缀。在"Examples"子目录中的包应该有一个相应的文件。一旦该文件已被确定,demoExample只是调用demoSource。


参数:package
The name of the package to use to find the example file.
的包的名称,使用的示例文件。


Details

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

The demo is begun by starting R twice in two separate shell (terminal) windows, in the same working directory, the input window and the demo window. To start the demo, the user calls demoInput in the  input window, with no arguments. The call to demoInput goes into a loop reading terminal input.
在演示开始通过启动R两次在两个单独的shell窗口(终端),在相同的工作目录,输入窗口和演示窗口。开始演示,用户要求demoInput在输入窗口中,不带任何参数。调用demoInput进入一个循环的阅读终端输入。

In the demo window, the user then calls demoSource, usually just supplying the file name for the source file. The input process now reads lines from the terminal and writes to a fifo that will be read by the demo process.  Empty lines (the usual) alternately display and evaluate single lines from the source file. A line consisting only of a comma is a continuation:  The next line of the source is read and displayed but not yet evaluated.  Use this mechanism to collect a bunch of lines to be evaluated together, such as a function definition.  When the last line of the bunch is displayed, enter an empty line to evaluate all the lines at once.
用户在演示窗口,然后调用demoSource,通常只是提供源文件的文件名。输入过程,现在从终端读入行,并写入到一个fifo将要读的演示过程。空行和往常一样,从源文件中的单个线交替显示和评估。一个只包含一个逗号是一个延续的源读取并显示下一行但尚未评价。使用此机制来收集一堆线进行评估,如一个函数的定义。当最后一行显示的一群,输入一个空行评估所有的线。

A line containing only q quits from demoInput, which you need to do before starting to run another demo. Quitting from the input also causes the quit command to be written to the fifo, at which point demoSource returns the current state of the demo. If you quit before the demo is finished, and you have arranged to assign the returned value from demoSource, that object can be supplied in a subsequent call to demoSource to resume this demo.
A线只包含q demoInput,你需要做的开始运行另一个演示之前,退出。退出从输入quit命令写入FIFO,在这一点demoSource返回当前状态的演示。如果你退出之前,演示结束后,你已经安排到指定的返回值demoSource,该对象可提供的后续调用demoSource恢复这个演示。

Any input other than an empty line, comma or q is interpreted as a literal expression that the user wants evaluated instead of the next source line.
一个空行,逗号或q以外的任何输入被解释为一个用户想要的文字表达,而不是一个源代码行评估。

Source lines in the demo file ending in "#SILENT" will be silently executed before the next ordinary line is displayed.
源代码行中的演示文件在"#SILENT"将被自动显示之前执行的下一个普通的线。


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

demoSource() and demoExample() return, invisibly, the "demoSource" object describing the current state of the demo.
demoSource()和demoExample()回报,无形之中,"demoSource"对象,用于描述当前状态的演示。


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

demoSource-class()
demoSource-class()

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-9 01:47 , Processed in 0.022145 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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