Skip to content

tcltk

3 messages · Christian Schulz, Peter Dalgaard, Dirk Eddelbuettel

#
HI,
(1) ...thanks for the last comments to tcltk & Win2000.
(2) - i'm newbie in tcl/tk but would like learn fast and develop
(learning by doing) a tcl/tk clusterAnalysis application which combine
some clusterMethods from different Rpackages.

i use the tkttest.R example as "reference" and become not finished for
my "first" step????
(3) how is it possible that the code from the tkttest.R example would
be execute and not only print to the screen; 
(4) Have somebody further "small" Rtcltk statistical sourceCode example's as
a further startingPoint for me ?

thanks for advance &
regards,christian



require (tcltk) || stop("tcltk support is absent")
require(cluster)
require(mva)
require(foreign)
local ({
dialog.fc <- function() {
tt <- tktoplevel()
tkwm.title(tt,"Fuzzy-ClusterAnalysis")
		cdata.entry <- tkentry(tt,textvariable="cdata")
		k.entry <- tkentry(tt,textvariable="k")
		reset <- function ()  {
			tclvar$cdata <- ""
			tclvar$k	 <- ""
		}
 reset.but <- tkbutton(tt,text="Reset", command=reset)
 submit.but <- tkbutton(tt,text="submit",command=function()tclvar$done<-1)
 
 build  <- function()
 	{
	 x <- parse(text=tclvar$cdata) [[1]]
	 y <- parse(text=tclvar$k)	[[1]]
  result <- substitute(fanny(x,y))
}

tkgrid(tklabel(tt,text="Fuzzy-Cluster"),columnspan=4)
tkgrid(tklabel(tt,text="data"),cdata.entry)
tkgrid(tklabel(tt,text="numberOfCluster"),k.entry)
tkgrid(submit.but, reset.but)

 tkbind(tt, "<Destroy>", function()tclvar$done<-2)
 tkwait.variable("done")
if(tclvar$done=="2") stop("aborted")
tkdestroy(tt)
cmd <- build()
cat("### Command executed via Tk ###\n")
cat(deparse(build()),sep="\n")
cat("### -----\n")
eval (cmd)
}
tclvar$cdata <- read.spss("c:/Rdata/ordCluVars.sav")
tclvar$k <- "5"
dialog.fc()
}
)









_______________________________________________________________________




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
"C. Schulz" <ozric at web.de> writes:
Um, what are you trying to say here? In tkttest, the code is first
generated (using substitute), then deparsed and printed, then passed
to eval, and the result of dialog.t.test is the value of eval(cmd),
i.e. the call to t.test (which is generally printed at the end).
Something might show up in Rnews.

...
This looks unhealthy. Tcl variables are generally simple strings, but
what you have on the RHS of that is a complicated structure.
#
I "collected" and rebuilt a few "widget" examples as well. I was wondering
if we should split off a r-sig-tcltk.  Would others see value in this? 

Dirk