rp.textentry(rpanel)
rp.textentry()所属R语言包:rpanel
Text entry boxes for a panel
文本输入框面板
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function adds one or more boxes which allow text to be entered.
该函数将一个或多个框,让输入文字。
用法----------Usage----------
rp.textentry(panel, var, action = I, labels = NA, names = labels, title = NA,
initval = NA, parent = window, pos = NULL, ...)
参数----------Arguments----------
参数:panel
the panel in which the text entry box(es) should appear. This may be passed as a panelname string or the panel object itself.
面板中的文本输入框(ES)应该会出现。这可能是通过作为一个panelname的字符串或面板对象本身。
参数:var
the name of the variable which will be assigned the text entered into the box(es).
在框中输入将被赋予文本的变量的名称(ES)。
参数:action
the function which is called when the text has been entered.
调用的函数时已经输入的文字。
参数:labels
a character string of labels for the text entry boxes.
一个字符串标签的文本输入框。
参数:names
the names attached to the elements of var. These provide a helpful means of referring to particular items in multiple textentry boxes.
名称附着元素var。它们提供了一个有用的手段指特定项目在多个TEXTENTRY盒的。
参数:title
a title for the group of text entry boxes. If there is only one box, and labels is not specified, title is taken as the label.
组的文本输入框的标题。如果只有一个方格,labels没有被指定,title被作为标签。
参数:initval
the initial value(s) for var (optional). The initial value(s) can also be specified in the call to rp.control.
初始值(S)的VAR(可选)。初始值(S),还可以指定在调用rp.control。
参数:parent
this specifies the widget inside which the text entry widget should appear. In the current version, it should not normally be used.
这指定的文本输入窗口小部件的部件里面出现。在目前的版本中,它不应该被使用。
参数:pos
the layout instructions. Please see the rp.pos example and help for full details.
布局说明。请看看rp.pos榜样和帮助的完整细节。
参数:...
information for pos can be passed individually as additional arguments.
pos的信息可以通过单独作为附加参数。
Details
详细信息----------Details----------
The function action should take one argument, which should be the panel to which the text entry box is attached.
函数action应该接受一个参数,这应该是面板的文本输入框。
See rp.grid for details of the grid layout system.
见rp.grid的网格布局系统的详细信息。
值----------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----------
The action function should return the panel. Without this assignment any widgets added or alterations made to panel parameters within the action function will be lost.
action函数应该返回面板。如果没有这个任务,任何部件或内action功能面板参数的改变将会丢失。
参考文献----------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()) {
plotf <- function(panel) {
with(panel, {
pars <- as.numeric(pars)
xgrid <- seq(0.1, max(c(pars[3], 5), na.rm = TRUE), length = 50)
dgrid <- df(xgrid, pars[1], pars[2])
plot(xgrid, dgrid, type = "l", col = "blue", lwd = 3)
if (!is.na(pars[3])) {
lines(rep(pars[3], 2), c(0, 0.95 * max(dgrid)), lty = 2, col = "red")
text(pars[3], max(dgrid), as.character(pars[3]), col = "red")
}
})
panel
}
panel <- rp.control(pars = c(5, 10, NA))
rp.textentry(panel, pars, plotf, labels = c("df1", "df2", "observed"),
initval = c(10, 5, 3))
rp.do(panel, plotf)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|