andrew....@lshtm.ac.uk wrote:

I want to be able to continuously plot the output from the model in R
each time a new run generates data.

From the C++ program, run the R script that plots the data. Something like this:

        system("Rscript myplotter.R");

That assumes Rscript is in the PATH, and that it works on Windows. I'll assume you can figure out the details.

You might also consider making the C++ program write the R script, so bits can vary. For instance, each iteration of the model could write out to a different data file, then call R from a new thread, so the R analysis stage doesn't interfere with the generation of the next iteration's results. Remove the now-unwanted data file when system() returns, and end the thread.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to