[R] interactive prompts
Jonathan Baron
baron at psych.upenn.edu
Mon Oct 20 13:06:51 CEST 2003
On 10/21/03 14:47, Ernie Adorio wrote:
>
>Am using R on a Linux box and am currently writing an interactive R script.
>
>1. How do I ask a user to press any key to continue ? I used a system call to
>read but this only works if the Enter key is pressed:
> print("Press any key to continue")
> system("read")
>
>2. How do I get a string input from the user? Would like to see an R function,
>say askget():
>
> delay = askget("Enter delay in seconds")
> system(paste( "sleep ", delay))
readline()
--
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
R page: http://finzi.psych.upenn.edu/
More information about the R-help
mailing list