[R] scan without line numbers?

Henrik Bengtsson henrikb at braju.com
Tue May 1 09:53:49 CEST 2001


I would like to have my own prompt, e.g.

  Enter the temperature: 123 [ENTER]
  You entered: 123

and

  Enter the temperature: [ENTER]
  [ENTER]
  [ENTER]
  123 [ENTER]
  You entered: 123

I'll use readLines(n=1) with a while loop.

Thanks!

Henrik

> -----Original Message-----
> From: ripley at auk.stats [mailto:ripley at auk.stats]On Behalf Of Prof Brian
> D Ripley
> Sent: Monday, April 30, 2001 10:49 PM
> To: Henrik Bengtsson
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] scan without line numbers?
> 
> 
> On Mon, 30 Apr 2001, Henrik Bengtsson wrote:
> 
> > When using the function scan(quiet=TRUE) the line numbers are printed.
> > Example:
> >
> >  > scan(quiet=TRUE)
> >  1: 123 [ENTER]
> >  2: [ENTER]
> >  [1] 123
> >  >
> >
> > Is it possible to not show the line numbers? I know about 
> readLines() but I
> > would like to be able to use the extra features of scan().
> 
> This only happens at what R thinks is a terminal in interactive use,
> and then I think one does need a distinct prompt to show that
> scan is waiting for input.   So, why do you want them suppressed?
> 
> As you can use readLines plus scan from text connection, there is an
> alternative route.
> 
> -- 
> 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 272860 (secr)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list