[R] R from outside program

Sean Davis sdavis2 at mail.nih.gov
Fri Sep 24 15:42:46 CEST 2004


You'll probably need to send your cmdfile.R to see what is in it, as 
that is where the problem likely is.  However, if you do something 
line:

pdf('my.pdf')
plot(1:10,1:10)
dev.off()

in your cmdfile.R, you will get a pdf file of the plot saved in the 
directory where you ran your script.  Note that you need to open a 
device like pdf, png, etc. for plots to be saved.  They aren't saved 
automatically

Sean

On Sep 24, 2004, at 9:24 AM, Poizot Emmanuel wrote:

> Hi all,
> I'm writing a program in C++ in witch there should be some graphical 
> outputs.
> To do so, I would like to use R with the command :
> R --no-save < cmdfile.R ,  where  I put the R graphic commands in the
> cmdfile.R file.
> I call R from my C++ code but as R seems to run in batch mode, there 
> are no
> graphical outputs!
> How can I do to get the graphics outputs ?
> -- 
> Sincerely
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Emmanuel Poizot
> Cnam/Intechmer
> B.P. 324
> 50103 Cherbourg Cedex
> Tél: (33)(0)233887342
> Fax: (33)(0)233887339
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list