[R] Simulate user input in R

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Wed Apr 24 09:04:00 CEST 2013

Your example is not reproducible, so it is open to misinterpretation.

Normally the approach taken in R is not to wait for user input, but have the user call the function with the desired values. One interpretation of your question is that the function you are using is broken by design, and you should re-write it.

Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
Sent from my phone. Please excuse my brevity.

Vahe nr <vner75 at gmail.com> wrote:

>Dear all,
>Can we simulate user input in R ?
>for example if we have a function which needs an input from the user to
>continue its work, can we automate this step (simulate the input...)
>Here is the sample:
>choose between one of the grouping factor available :
>c("Village", "Country")
>we need to enter Village or Country to continue.....can I automatically
>pass one of the values without user input.
> Vahe
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list