Hi the list, I need to use getGraphicsEvent to plot two graph. On the following toy example: - the function b is ploting two graph depending on a parameter - the function a is calling b according to some user answers. It is suppose to call b until the user press Return, but it does not.
b <- function(x){ dev.off(2);dev.off(3) windows();windows(3,3,xpos=0) dev.set(2);plot(1:x) dev.set(3);plot(1:x^2) return(NULL) } b(2) a <- function(y){ b(y) getGraphicsEvent("Arrow Up or Return", onKeybd=function(key){ if(key!="ctrl-J"){ if(key=="Up"){y <<- y+1}else{} b(y) cat("\n*** This function a never gets here... ***\n") return(NULL) }else{ return(TRUE) } } ) } a(3) Is there something wrong in my code, or something I did not understand in getGraphicsEvent ? I try on R 2.2.1, then on R 2.7 Thanks for your help. Christophe ---------------------------------------------------------------- Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre ______________________________________________ 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.