RE: [R] Newbie help with calling R from C programs

2004-02-08 Thread Liaw, Andy
If all you want R to do is the graphics, you might as well use gnuplot for that, IMHO. Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marko Krco Sent: Saturday, February 07, 2004 11:45 AM To: [EMAIL PROTECTED] Subject: [R] Newbie help with

RE: [R] Newbie help with calling R from C programs

2004-02-08 Thread Tom Blackwell
Marko - Here's how I would do it. Your simulation code writes (or overwrites) its summary to a named file. Then your simulation code does a system call (somehow) that creates a subshell with a Bourne or csh command line and sends the command R --vanilla script.file . (I'm not quite sure at

RE: [R] Newbie help with calling R from C programs

2004-02-08 Thread Tom Blackwell
Marko - I can't resist. The next more elegant solution would be to have a single R process poll the directory entry for named.file periodically to see whether the file date has changed since it was last read. See help(file.info) for an R tool that will help do this. Use 'system(sleep 600,

RE: [R] Newbie help with calling R from C programs

2004-02-08 Thread Tom Blackwell
Marko - . . . and, using a single R process, rather than calling it from inside the simulation code, means that the R process doesn't need to be running on the same machine as the simulation code. It only needs to run on a machine which has shared file access with the simulation process. And