Here is an example script that works for me (tested your first call method on Windows). It uses the tcltk package and creates an additional small window with a single button, the script pauses (but still allows you to interact with the rgl window) until you click the continue button, pressing the key while this window is active, then continue using the script .
library(tcltk) library(rgl) mywait <- function() { tt <- tktoplevel() tkpack( tkbutton(tt, text='Continue', command=function()tkdestroy(tt)), side='bottom') tkbind(tt,'<Key>', function()tkdestroy(tt) ) tkwait.window(tt) } x <- rnorm(10) y <- rnorm(10) z <- rnorm(10) plot3d(x,y,z) mywait() x <- rnorm(100) y <- rnorm(100) z <- rnorm(100) plot3d(x,y,z) mywait() cor(x,y)
Greg snow
source share