[R] readline() and Rterm in Windows

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Nov 2 18:23:43 CET 2005


What does `not work' mean here?  In particular, what does `running an R 
script in' mean?

It works as I would expect: if foo.R contains

 	id <- readline("Please enter ID: ")

then

> source("foo.R")
Please enter ID: 5
> id
[1] "5"

Please do read the posting guide and explain what you are doing it enough 
detail for people to reproduce it.


On Wed, 2 Nov 2005, Mikkel Grum wrote:

> I'm running an R script in Rterm and would like the
> user to be prompted for input as in:
>
> id <- readline("Please enter ID: ")
> myfunction(id)
>
> . . . etc.
>
> This works when I run one line at a time in RGui, but
> not when I try to run the script in Rterm (I'm working
> with R 2.2.0 in Windows Server 2003).
>
> Is there any way to do this?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list