[R] Sorry, My Mistake in the code

jw9@softhome.net jw9 at softhome.net
Wed May 29 20:49:52 CEST 2002


Thanks, Peter. 

Actually I use function()tk2() instead tk2(). I tried just use tk2, the 
result is the same as yours.  By the way, could you provide more detail 
about
how to assign tk2 to a global variable. 

Thanks! 

############################# 

tk1 <- function() {
	tk2 <- function() {
		inner <- 3
		list2 <- ls()
		#list objects in fuction tk2
		print("**** inner objects ****")
		print(list2)
		
		#list objects in fuction tk1
		list_parent <- ls(parent.frame())
		print("**** outer objects ****")
		print(list_parent)
	}
	tt <- tktoplevel()
	outer <- 1
	tkpack(tkbutton(tt,text="push",command=function()tk2()))
	tk2()
} 

############################# 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list