rp.control(rpanel)
rp.control()所属R语言包:rpanel
Create an rpanel
创建一个rpanel
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function creates a panel window into which rpanel widgets can be placed. It also returns, and can set up variables within, the rpanel object.
这个函数创建一个到面板窗口小部件可以放置rpanel。它也返回,并且可以设置变量内中,rpanel对象。
用法----------Usage----------
rp.control(title = "", size = c(100, 100), panelname, realname, aschar = TRUE, ...)
参数----------Arguments----------
参数:title
the title of the panel displayed in the banner.
面板的标题中显示的旗帜。
参数:size
a two-element numeric vector specifying width and height of the panel in pixels. If this argument is omitted the size of the panel will adapt to the subsequent addition of widgets.
一个有两个元素的数值向量指定宽度和高度(以像素为单位)的面板。如果省略该参数,尺寸的面板将适应随后添加的窗口小部件。
参数:panelname
the name of the panel at .rpenv. If this is not assigned, then realname is taken.
的名称的面板。rpenv。如果这没有被分配,然后实名采取。
参数:realname
retained for backward compatibility. If this is not assigned, the realname is assigned automatically using rp.panelname.
保留向后兼容。如果不这样分配的,分配的真实姓名自动使用rp.panelname。
参数:aschar
if TRUE (default) the panel's name as a string is returned. If FALSE the panel list itself is returned.
如果是TRUE(默认值)面板的名称作为一个字符串返回。如果小组名单本身,则返回FALSE。
参数:...
additional arguments which are treated as variable initialisations and are stored within the returned rpanel object. For example inserting x=3 creates a variable x in the rpanel object with the value 3. Note that the names of these additional arguments should not conflict with those of the main arguments of rp.control.
额外的参数被视为变量initialisations都存储内返回的rpanel对象的。例如插入x=3创建一个变量x中的rpanel的对象的值3。请注意,这些额外的参数的名称应该不冲突的rp.control的主要论点。
Details
详细信息----------Details----------
On some machines the R and Tcl/Tk code can become out of step if a large number of objects, or objects of large size, are passed in .... This can lead to the panel failing to size itself appropriately. A solution is to insert a Sys.sleep(0.5) instruction immediately after the call to rp.control, to ensure that sufficient time is allowed for the initialisation to complete. Clearly, the duration of the sleep time may need to be adjusted on different machines.
在某些机器上的R和Tcl / Tk代码的步骤,如果可以成为大量的对象,或大尺寸的对象,通过在...。这可以导致未能适当大小本身的面板。一种解决方法是插入一个Sys.sleep(0.5)指令后,立即调用rp.control,以确保有足够的时间让初始化完成。显然,睡眠时间的持续时间可能需要进行调整,在不同的机器上。
值----------Value----------
Dependent on parameter ischar. If ischar is TRUE this is the string name of the panel if FALSE this is the list object which defines the panel.
依赖于参数ischar。如果ischar是TRUE,这是面板如果为FALSE,这是它定义了面板的列表对象的字符串名称。
参考文献----------References----------
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
参见----------See Also----------
rp.button,rp.slider,rp.doublebutton,rp.textentry,rp.checkbox,rp.radiogroup
rp.button,rp.slider,rp.doublebutton,rp.textentry,rp.checkbox,rp.radiogroup
实例----------Examples----------
if (interactive()) {
hist.or.boxp <- function(panel) {
if (panel$plot.type == "histogram")
hist(panel$x)
else
boxplot(panel$x)
panel
}
panel <- rp.control(x=rnorm(50))
rp.radiogroup(panel, plot.type, c("histogram", "boxplot"), title="Plot type", action = hist.or.boxp)
# Try also[尝试也]
# panel <- rp.control(ischar = TRUE) # returns a string ".rpanel1" in panel[面板 - rp.control(ischar = TRUE)返回一个字符串“。rpanel1”面板]
# panel <- rp.control(ischar = FALSE) # returns the panel list object itself[面板 - rp.control(ischar = FALSE)#返回面板列表对象本身]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|