Thank you very much for these links! They are very informative and helpful!
Hello all,
I'm stuck with a specific question concerning the communication between Perl and R, via Perl module Statistics::R. I want to create an interactive 3D scatter plot using R module rgl. When I manually did it in R console, it worked perfectly. I could mouse-rotate the graph in a window. However, when I tried to automate the process with Perl, the graph was displayed, but was dead. I couldn't rotate. My system is Ubuntu 12.04. Perl and R are up-to-date. I don't know where the problem is, but just guess it's a window rendering problem.
What I did in Perl is (simply):
$R->send("library('rgl')");
$R->send("plot3d(x, y, z, xlab='x', ylab='y', zlab='z', title='3D scatter plot')");
Can anyone point out what is wrong? Thanks!
1 answer
I suspect this may not possible in the way that you hope... Although I also hope I am wrong because I can think of some potential use cases for this behavior.
This question is probably of interest to many here who routinely visualize biological data in R, but I agree with Neilfws that it is perhaps more suited to stackoverflow.
These questions from stackoverflow sound relevant:
Switch R script from non-interactive to interactive
Running Statistics::R module in Perl on Mac OS - no image being produced
As do these threads from the R mailing list
[R] R script to start session (without automatically finishing)
From this thread: "You need to explicitly start an x11 driver if you are not running interactively, ie using the x11() function."
Log in to answer this question.
Relevance of this question to a bioinformatics research problem please?
better ask this is stack overflow