Dear users, I have looked on different sources and found different functions to prompt the user to provide input. However, I couldn't find one that does exactly what I'm looking for. select.list() and menu() are nice because a graphic window appears to prompt the user. However, the user can only choose from a predefined list of choices. readline() and scan() are more free in the input but prompt the user in the console. Examples: a <- select.list(choices=c("0.0","0.1","0.2"), title="select number") a ## I cannot choose "0.15" [1] "0.1" b <- readline(prompt="select number ") select number 0.2 ## in the console, not really visible b [1] "0.2" I would like both "free" input and a pop-up window. Is there a function for this? Thanks in advance, Ivan -- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. S?ugetiere Martin-Luther-King-Platz 3 D-20146 Hamburg, GERMANY +49(0)40 42838 6231 ivan.calandra at uni-hamburg.de ********** http://www.for771.uni-bonn.de http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php
Thanks for your answer. But I don't understand anything, I would say it's far beyond my current knowledge. Could you please explain me in more details how this works? Ivan Le 4/20/2011 11:40, Juan Carlos Borr?s a ?crit :> An alternative is to run your R programs as scripts (#!/usr/bin/env > Rscript) and pass user input as command line parameters. > After all you can already set runtime params if you're developing with > you IDE of choice, right? > > Cheers, > jcb! > _______________________ > http://twitter.com/jcborras > > > On Wed, Apr 20, 2011 at 12:00 PM, Ivan Calandra > <ivan.calandra at uni-hamburg.de> wrote: >> Dear users, >> >> I have looked on different sources and found different functions to prompt >> the user to provide input. However, I couldn't find one that does exactly >> what I'm looking for.-- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. S?ugetiere Martin-Luther-King-Platz 3 D-20146 Hamburg, GERMANY +49(0)40 42838 6231 ivan.calandra at uni-hamburg.de ********** http://www.for771.uni-bonn.de http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php
Hi Ivan, there are also data.entry() and edit(), which are more tailored to data frames and might look awkward for entering a single value. You could also take a look at CRAN, maybe there is a GUI package that does what you want. Andreas Ivan Calandra schrieb:> Dear users, > > I have looked on different sources and found different functions to > prompt the user to provide input. However, I couldn't find one that > does exactly what I'm looking for. > > select.list() and menu() are nice because a graphic window appears to > prompt the user. However, the user can only choose from a predefined > list of choices. readline() and scan() are more free in the input but > prompt the user in the console. > > Examples: > a <- select.list(choices=c("0.0","0.1","0.2"), title="select number") > a ## I cannot choose "0.15" > [1] "0.1" > > b <- readline(prompt="select number ") > select number 0.2 ## in the console, not really visible > b > [1] "0.2" > > > I would like both "free" input and a pop-up window. Is there a > function for this? > > Thanks in advance, > Ivan >-- Andreas Borg Medizinische Informatik UNIVERSIT?TSMEDIZIN der Johannes Gutenberg-Universit?t Institut f?r Medizinische Biometrie, Epidemiologie und Informatik Obere Zahlbacher Stra?e 69, 55131 Mainz www.imbei.uni-mainz.de Telefon +49 (0) 6131 175062 E-Mail: borg at imbei.uni-mainz.de Diese E-Mail enth?lt vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und l?schen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail und der darin enthaltenen Informationen ist nicht gestattet.