I am calling R from within Java. 
 
But I don't think that I can get any plots written to file from R - inside
Java.
 
This snippet of code(from a larger piece of code) compiles in Java, but
doesn't do anything!
 
 
 
 
 
functions.append("trial<-c(1,3,4,5)\n");
            
            functions.append("dawpdf<-function(filename){\n");
            functions.append("
dev.print(device=pdf,file=filename,\n");
            functions.append("
width=6,height=6,onefile=TRUE,family=\"Helvetica\",\n");
            functions.append("                     title=\"R Graphics
Output\")\n");
            functions.append("                     }\n");
            functions.append("plot(trial)\n");
           
functions.append("c<-dawpdf(\"trial.pdf\"\n");
            functions.append("c\n");
 
 
Is it possible to write plots to files from R code which is imbedded in
java?
 
 
-------------------------------------------------
 
Laura Jane Dow
 
 
	[[alternative HTML version deleted]]
Hi Bobby,
 
You are right - "functions" is a StringBuffer object.
 
I've compiled without the syntax error.
 
The error message is: Error in dev.print(....
                      can only read screen device
 
Do you think this means that RTerm doesn't actually produce a
Screen plot when called from Java?
 
i.e., functions.append("plot(something)\n");
 
doesn't produce a screen plot anywhere?
 
Regards,
 
Laura
 
 
-------------------------------------------------
 
Laura Jane Dow
 
Energy Scitech Ltd,
Scitech House,
1 Barnby Road,
Knaphill,
Woking,
Surrey.
GU21 2NL
 
laura.dow@enscitech.com
Phone:  +44 (0)1483 79 50 58 Direct
Phone: +44 (0)1483 79 78 00 Central 
Fax:     +44 (0)1483 79 76 00
Mobile: +44 (0)7763 10 54 07
 <http://www.enscitech.com/> http://www.enscitech.com
 
	[[alternative HTML version deleted]]