Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: User input from shell script


From   "Thomas, Anthony" <[email protected]>
To   [email protected]
Subject   st: User input from shell script
Date   Thu, 14 Nov 2013 17:15:41 -0500

Hi Statalist,

I am trying to write an ado file (Stata 11 for Linux) that calls an R
program which requests user input from "stdin" - in this case the
system command line. So a simplified example would be:

     shell Rscript rProgram.r ...

The R program will periodically pause and request input from the user
before continuing. For those familiar with R, the actual call in the
program is: readLines(file('stdin'), 1).

However, when the R program is called from Stata, R does not recognize
the Stata command line as a source of input and skips the steps of
asking for user input. Is there any way to pipe the output of the
Stata command line to R, or to the system command line? I hope this
question makes some sense...

Thanks,

Anthony
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index