Ca219 Project Suggestions: Suggestion 1: Use the facilities in the base R: ?menu # for help menu(c("Binomial","Geometric", "Hyper"), graphics = TRUE, title = "Which distribution?") dist<-menu(c("Binomial","Geometric", "Hyper"), graphics = TRUE, title = "Which distribution?") #stores in dist ?winDialog #for help winDialog (type = c( "yesno"), "Do you want another distribution?") winDialog(type = c("ok"), "Do you want to continue?") winDialog(type = c("okcancel"), "Do you want to continue?") winDialog(type = c("yesno"), "Do you want to continue?") winDialog(type = c("yesnocancel"), "Do you want to enter different parameters?") ?winDialogString #for help winDialogString("Which Distribution? Enter 1 for geometric, 2 for binomial", " " ) as.numeric converts a string to a numeric, for example p<-winDialogString("What is the probability of success?", " ") #enters a string value for "p" p<-as.numeric(p) #converts the string "p" into numeric so that you can carry out caculations with p The "if" statement directs your program The "break" statement exits a loop Suggestion 2: There are many packages available in R (for example tcltk, Rcmd ) which you can load and use. tcltk Example require(tcltk) #loads the package http://www.sciviews.org/_rgui/tcltk/index.html #contains coding examples http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/ #contains more examples ls("package:tcltk") #lists all the commands in tcltk ?tktitle #explains the command tktitle install.package(tcltk) The other packages operate in the same way. Suggestion 3: You can use a combination of a package and the windialog commands. To run a program stored in subdirectory Rprog of C: >source("c:/Rprog/userinterfacesinR.R") #executes the commands stored in userinterfacesinR.R