Hello R tcltk world:
After a month without success, I seek help.  Perhaps one of you has the knowledge to construct a checkbutton for each element of vector of variable length, select any combination of buttons, and then output the vector of selected buttons.  The following code does not work:

require(tcltk)
Buttons <- c(2,5,7)
tt <- tktoplevel()
for(i in 1:3) {
  ButtonName <- as.name(paste("B", Buttons[i], sep=""))
  ButtonName <- tkcheckbutton(tt)
  ButtonValue <- as.name(paste("B", Buttons[i], "Value", sep=""))
  ButtonValue <- tclVar("0")
  tkconfigure(ButtonName, text=paste(Buttons[i]), variable=ButtonValue, indicatoron=0)
  tkpack(ButtonName)
}
OK <- tkbutton(tt,text="OK", command=function() { for(i in 1:3) {
  if(as.character(tclvalue(paste("B",Buttons[i],"Value", sep=""))) == "1") Selected <<- c(Selected, Buttons[i])}} )
tkpack(OK)
Selecting any combination of checkbuttons results in the message "Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class = "tclObj") : [tcl] can't read "B2Value": no such variable."  When the evaluated results of as.name ... are entered interactively in place of the loop with ButtonName and ButtonValue variables, the mini GUI works.  How would checkbutton names and checkbutton variable values generated in a loop be correctly implemented?
Thanks,
Bill Morphet, Space shuttle analyst/USU PhD statistics student
   
	[[alternative HTML version deleted]]

