[R] Command to input a variable value in real time

Franklin Bretschneider bretschr at xs4all.nl
Mon Oct 12 15:44:27 CEST 2015


Dear nicholas.wray,


Re:

> Hi  I am sure that there is a command in R which tells the prog to wait until
> you have input a value for a variable, but for the life of me I can't find it.
> Searches on the net only seem to talk about inputting datasets etc, not about
> real time single inputs. I'd be most grateful if anyone could point me in the
> right direction
> 
> Thanks, Nick Wray
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Maybe you need "readline()" in base-R:

> 
> readline {base}	R Documentation
> Read a Line from the Terminal
> 
> Description
> 
> readline reads a line from the terminal (in interactive use).
> 
> Usage
> 
> readline(prompt = "")
> 
> Arguments
> 
> prompt	
> the string printed when prompting the user for input. Should usually end with a space " ".
> 

Best wishes,

Frank
---





Franklin Bretschneider
Dept of Biology
Utrecht University
bretschr at xs4all.nl



More information about the R-help mailing list