I am using the RGL library in scripted (non-interactive) mode, but wish to
give the data analyst an opportunity to exam the 3D plots. The "data
analysts" understand the data, but not R. My intent is to provide simple
Windows (XP) batch files that call R and automatically pass scripts to it,
and thus permit the analyst to easily access graphics without having to cut
and paste commands into R. This leads to several questions:

 

1.    Is there any way to save the 3D object so that it can later be
restored and manipulated without rerunning the script that created it? This
would be the ideal solution, so the analyst can simply pull up the 3D object
and examine the data at a convenient time. My hope would be that some method
would exist to save as a full 3D object the graphic created using rgl, and
subsequent call it up with a command along the lines of r < 3dobject.RData
-vanilla.



2.    A less optimal solution would be to pause the scripted
(non-interactive) session while the 3D object is available. In my Windows
environment I've tried various suggestions from the archives without
success:

a.    par(ask=TRUE) (requires creating dummy graphs to obtain a pause, since
par3d does not support ask)

b.    readline(prompt = "Pause. Press <Enter> to continue...")

c.    pause() in the DAAG package

d.    scan(). 

e.    locator()



3.    Here is a test script (pause.txt) showing the above suggestions fail:

require(DAAG)

X <- seq(0,10)

par(ask=TRUE)

plot(X,X)

pause()

locator(type="p")

browser()

scan()

readline(prompt = "Readline pause. Press <Enter> to continue...")

plot(x^2~x)

 

I call this with:

r < pause.txt - save

 

The file runs from beginning to end without stopping. 

 

4.    I do have a very NONELEGANT solution:

 

cat("Press <Control-C> to end (rather crudely)")

while (TRUE){}

 

This does work, but it requires exiting R using control-C, which is not very
satisfying. 

 

Any help would be appreciated,

 

Steve Shafer

 


	[[alternative HTML version deleted]]

