Call R-Graphics from C ++ using RInside / Rcpp

Is it possible to call plot functions from C ++? Currently, when I try to do this, the terminal of the ubuntu terminal freezes for a while (there may be a duration in which a 3D graph will be created and then rotated 360 degrees), and then it defrosts without causing a new window. Is this expected behavior or is there something I'm doing wrong? How can I get graphs (R-graphics) to run from C ++ using rinside and rcpp?

Thnx

-Egon

+7
source share
2 answers

Yes, there are working examples in the Rcpp package. See the functionCallback/newApiExample.r in the examples/ directory.
You may need to experiment with sleep() to “hold” the chart for a moment, or put it into a file and then display the file. It all depends on you, but you have said little.

+5
source

Interactive session environment variable R_INTERACTIVE_DEVICE .
We need to create a file called .Renviron in our home directory, and then add the following code to it:

R_INTERACTIVE_DEVICE = X11 for Linux systems.

 anisha@linux-y3pi :~> ls .Renviron .Renviron anisha@linux-y3pi :~> cat .Renviron R_INTERACTIVE_DEVICE = X11a 

Literature:
1.http : //stat.ethz.ch/R-manual/R-patched/library/base/html/Startup.html
2. http://stat.ethz.ch/R-manual/R-patched/library/base/html/options.html

+1
source

All Articles