einsundeins <floriansense <at> gmail.com> writes: > > > Hello everyone, > > this is my first post here and I hope I signed up correctly and someone will > take me by the hand and help me out. I am new to R and cannot figure out > what to do here... > > ... I want to have an User Interface that requests input. I want to save > this input to a variable to use it later on. I was able to do this with a > modalDiaglog ( > http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/modalDialog.html like > this ) but I cannot figure out how to do this with multiple values to be > read. > > I want to run a rather simple simulation and the user has to be able to set > multiple parameters (say, number of trials and stimuli). The onOK-function > should then "collect" these parameters and save them to variables (I guess). >
Dear Florian, you may want to look at the gWidgetstcltk package which makes such things a bit easier than plain tcltk. Here is one way with a modal dialog: f <- function() { library(gWidgets) options("guiToolkit"="tcltk") dlg <- gbasicdialog() tbl <- glayout(cont = dlg) tbl[1,1] <- "trials" tbl[1,2] <- (trials <- gedit("100", coerce.with=as.numeric, cont = tbl)) tbl[2,1] <- "Stimuli" tbl[2,2] <- (stimuli <- gedit(10, coerce.with=as.numeric, cont = tbl)) visible(dlg, set=TRUE) return(sapply(list(trials, stimuli), svalue)) } > > Best regards, > Florian ______________________________________________ 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.