Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Stata code to run R code from within Stata and returncertain pieces of the results as Stata macros


From   Daniel Becker <daniel.becker@uni-rostock.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Stata code to run R code from within Stata and returncertain pieces of the results as Stata macros
Date   Sat, 31 May 2008 09:30:41 +0200

Am 31.05.2008 um 09:16 schrieb Daniel Becker:

I'm sure the devil is in the details (eg there are issues with
coordinating the running of Stata and R). For instance, Stata may have
to go to sleep until R signals that the code execution is over etc.
But the above does not seem any more daunting than the average ado out
there.
Wouldn't the easy check be: Stata, please white until the file /file/ that/is/the/result/of/executing/R/ exists?
A variant of the pause command? How about an option waitfor(/file/ that/is/the/result/of/executing/R/results.txt) for rsource?
problem solved: google returned http://datasets.org/statalist/archive/2002-06/msg00295.html

capture confirm file c:\wherever\output.txt
	while _rc { /* file does not exist! */
	sleep 1000 /* wait 1000 ms = 1 second before trying again */
	capture confirm file c:\wherever\output.txt
	}

Daniel
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index