Dear experts, I am trying to understand why is it that when I paste (into the R console) the following code to select an option from a list:
require(tcltk) tt<-tktoplevel() tl<-tklistbox(tt,height=ntx,selectmode="single",background="white") tkgrid(tklabel(tt,text="Select the legend of" )) tkgrid(tl) treatments<<-levels.tx for(i in (1:ntx)) { tkinsert(tl,"end",treatments[i]) } OnOK<-function() { tx.choice1<<-treatments[as.integer(tkcurselection(tl))+1] tkdestroy(tt) } OK.but<-tkbutton(tt,text=" OK ", command=OnOK) tkgrid(OK.but) tx.choice1 the console can't find tx.choice1, but if I type tx.choice1 directly into the console, it returns the value I selected from the list. I am running R 2.7.1, OS: linnux, I run R within emacs. Thank you very much for you help, Judith ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.