Skip to content

how i can get input from "user input"

4 messages · Greg Snow, Bert Gunter, Martin Maechler +1 more

#
Also look at ?readline

Greg Snow, Ph.D.
Statistical Data Center
greg.snow at ihc.com
(801) 408-8111
Cuichang Zhao wrote:

            
Depends on the kind of input.

See, e.g., ?scan or ?menu

Uwe Ligges
http://www.R-project.org/posting-guide.html 

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
#
If you are on Windows and want to go GUI, see ?choose.files, ?winMenuAdd,
?winDialog, ?select.list

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box
#
BertG> If you are on Windows and want to go GUI, see
    BertG> ?choose.files, ?winMenuAdd, ?winDialog, ?select.list

with the big drawback that it will only work on Windows.

As Uwe says below, it depends on your context;
for relative simple things, however please consider a portable
solution, using
	  	  menu(), readline(), ..

BTW, menu() has been improved in R 2.1.0 (alpha --> please test!),
and is now connected with select.list() which should work on all
platforms (and uses tcltk on Linux when available).


Martin Maechler, ETH Zurich


    BertG> -- Bert Gunter
    BertG> Genentech Non-Clinical Statistics
    BertG> South San Francisco, CA
 
    BertG> "The business of the statistician is to catalyze the scientific learning
    BertG> process."  - George E. P. Box
 
 

    >> -----Original Message-----
    >> From: r-help-bounces at stat.math.ethz.ch 
    >> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Greg Snow
    >> Sent: Wednesday, March 30, 2005 9:45 AM
    >> To: ligges at statistik.uni-dortmund.de; cuiczhao at yahoo.com
    >> Cc: r-help at stat.math.ethz.ch
    >> Subject: Re: [R] how i can get input from "user input"
    >> 
    >> Also look at ?readline
    >> 
    >> Greg Snow, Ph.D.
    >> Statistical Data Center
    >> greg.snow at ihc.com
    >> (801) 408-8111
    >> 
    >> >>> Uwe Ligges <ligges at statistik.uni-dortmund.de> 03/29/05 11:43PM >>>
>> Cuichang Zhao wrote:
>> 
    >> > Hello, 
    >> > Could you please tell me how i can get an input from the user in R?
    >> 
    >> Depends on the kind of input.
    >> 
    >> See, e.g., ?scan or ?menu
    >> 
    >> Uwe Ligges
    >> 
    >> 
    >> > C-Ming 
    >> >  
    >> > Mar 29, 2005
    >> > 
    >> > 		
    >> > ---------------------------------
    >> > 
    >> > 
    >> > 	[[alternative HTML version deleted]]
    >> > 
    >> > ______________________________________________
    >> > R-help at stat.math.ethz.ch mailing list
    >> > https://stat.ethz.ch/mailman/listinfo/r-help 
    >> > PLEASE do read the posting guide!
    >> http://www.R-project.org/posting-guide.html 
    >> 
    >> ______________________________________________
    >> R-help at stat.math.ethz.ch mailing list
    >> https://stat.ethz.ch/mailman/listinfo/r-help 
    >> PLEASE do read the posting guide!
    >> http://www.R-project.org/posting-guide.html
    >> 
    >> ______________________________________________
    >> R-help at stat.math.ethz.ch mailing list
    >> https://stat.ethz.ch/mailman/listinfo/r-help
    >> PLEASE do read the posting guide! 
    >> http://www.R-project.org/posting-guide.html
    >> 

    BertG> ______________________________________________
    BertG> R-help at stat.math.ethz.ch mailing list
    BertG> https://stat.ethz.ch/mailman/listinfo/r-help
    BertG> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
#
On Thu, 31 Mar 2005, Martin Maechler wrote:

            
I don't think that a `big' drawback if you `want to go GUI', as GUI
conventions are so different between platforms (and tcltk being different
from the `native' one on each platform).  But we are beginning to attempt
to add platform-independent wrappers to GUI widgets.
To be a bit more specific,

menu() has a 'graphics' argument that uses a listbox on Windows, MacOS or
tcltk (where available).

select.list() works on all platforms, graphically as for
menu(graphics=TRUE), otherwise in text mode.

I intend to add a tcltk-based version of choose.files().  (One of the
problems with tcltk is that its widgets are OS-specific, and getting
select.list to choose a reasonable height tooks ages: there needs to a
fudge factor of 3 pixels/line on Unix and 1 pixel/line on Windows.)