rp.block(rpanel)
rp.block()所属R语言包:rpanel
Blocks use of the R console until a panel is closed
块使用的R控制台面板关闭直到
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function prevents the R console from accepting further input waits until a panel is closed. The function has two uses: The first is to keep R active when an R script is run in batch mode. This prevents the R session from terminating until the panel has been closed. The second use is to block the user from further use of the command prompt. There may be circumstances in which it is helpful to do this.
该功能可以防止R控制台接受进一步的输入等待,直到面板关闭。该函数有两个用途:第一是保持ŕ活跃的一个的R脚本是在批处理模式下运行时。这可以防止R会话终止,直到面板已关闭。第二个用途是阻止用户进一步使用的命令提示符下。但在某些情况中,它是有帮助的做到这一点。
用法----------Usage----------
rp.block(panel)
参数----------Arguments----------
参数:panel
the panel whose closure will lead to termination of rp.block. This may be passed as a panelname string or the panel object itself.
面板的关闭将导致终止的rp.block。这可能是通过作为一个panelname的字符串或面板对象本身。
Details
详细信息----------Details----------
rp.block should usually be the very last function executed in a script, to prevent termination until the panel has been closed. It should not normally be used in interactive mode, except where one wishes to prevent use of the R command line whilst the panel is running.
rp.block通常应该在脚本中最后执行的功能,以防止面板已关闭,直到终止。通常它不应该被用来在交互模式,但是其中一个希望,以防止面板运行的R命令行中使用,而。
值----------Value----------
If the parameter panel is the panelname string the same string is returned. If the panel object is used the altered panel is assigned to both the calling level and panel's environment level.
如果该参数面板是panelname的的字符串相同的字符串返回。如果面板对象是用来改变的面板被分配到的层次和面板的环境。
警告----------Warning----------
Note: This may stop the panel responding to button and other events in MacOS command line.
注意:这可能停止面板按钮和其他活动在MacOS命令行。
参考文献----------References----------
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
参见----------See Also----------
rp.control
rp.control
实例----------Examples----------
if (interactive()) {
# This function will be called on pressing the button "Simulate".[此功能会被要求按下按钮“模拟”。]
boxp.sim <- function(panel) {
boxplot(rnorm(50))
panel
}
# Create an rpanel and add the button "Simulate" to it.[创建一个rpanel,并添加“模拟”按钮。]
panel <- rp.control()
rp.button(panel, action = boxp.sim, title = "Simulate")
rp.block(panel)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|