[R] R+Stata batch mode

peter dalgaard pdalgd at gmail.com
Fri May 25 15:19:20 CEST 2012


On May 25, 2012, at 14:46 , Francesco wrote:

> Dear R help,
> 
> I am using Stata, and I use a Stata ado file (Rsource) to run R in batch
> mode within Stata
> 
> Everything works fine .... except for the fact that I cannot export the
> graphics that I obtain with my computations written in my R source file
> I believe this is related to the global Rterm_options `"--vanilla"' that I
> need to precise to Rsource (otherwise it does not work) ...
> What kind of options should I precise instead in order to be able to use
> the R line :
> 
> png('mygraph.png')
> dev.off()
> 
> ? At the moment the file obtained (mygraph.png) is void ... but strangely
> enough the pictures are exported in a pdf file... which is not what I want
> anyway
> 
> Any help ?

Apologies if I'm being silly, but:

You do know that the graphics commands need to go _between_ png() and dev.off()?

Otherwise, perhaps the png device didn't start. There should be an error message in the output file in that case.

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list