whichbutt(RPMG)
whichbutt()所属R语言包:RPMG
Determines which button was selected in RPGM
确定哪个按钮被选择在RPGM
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Function to determine which button of the RPMG was selected during a graphics session.
在图形会话功能,以确定哪些的RPMG按钮被选中。
用法----------Usage----------
whichbutt(v, buttons)
参数----------Arguments----------
参数:v
list of x,y coordinates obtained from the locator() function
列表中得到的x,y坐标从定位器()函数
参数:buttons
list of buttons set by the function rowBUTTONS
设置的功能rowBUTTONS的按钮列表
Details
详细信息----------Details----------
whichbutt uses the geometry determined by rowButtons and a list of locator() points to return the buttons clicked on or, if none, 0.
whichbutt使用的几何形状由rowButtons和一个定位器(名单)点,点击返回按钮,如果没有,0。
值----------Value----------
Returns a vector of indexes to buttons selected by the user. Buttons are numebred 1-N so if a click is not on a button, zero is returned.
返回一个向量的索引由用户选择的按钮。 1-N,因此,如果某次点击一个按钮,零,则返回按钮的numebred。
注意----------Note----------
This function can be used to get interaction with predined buttons and non-button clicks using locator().
这个功能可以被用来获得与使用定位器()predined按钮和无按钮的点击互动。
(作者)----------Author(s)----------
Jonathan M. Lees <jonathan.lees@unc.edu>
参见----------See Also----------
rowBUTTONS, locator
rowBUTTONS,定位器
实例----------Examples----------
################### initial plot[##################初始地积]
plot(c(0,1), c(0,1))
###### set buttons[#####设置按钮]
mybutts = c("DONE", "REFRESH", "rainbow", "topo", "terrain", "CONT",
"XSEC","PS" )
colabs = rep(1, length=length(mybutts))
pchlabs = rep(0,length(mybutts))
###### set button geometry [#####设置按钮形状]
buttons = rowBUTTONS(mybutts, col=colabs, pch=pchlabs)
######## user clicks on plot. When locator finishes, whichbutt[#######用户点击的图。当定位完成后,whichbutt]
######## determines which buttons were selected and returns the vector[#######确定哪个按钮被选择,并返回该向量]
L = locator()
K = whichbutt(L, buttons)
print(K)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|