[R] return from nested function?

jhallman@frb.gov jhallman at frb.gov
Fri Feb 25 21:34:20 CET 2005


Is is possible from within a function to cause its caller to return()?

I have a function that lets user make edits to certain objects, and then
checks that the edited objects still make sense.  If they don't, the function
puts up a notifier that the edits are being discarded and then returns,
something like:

   if(badEdits){
       notifyDialog("bad edits will be ignored")
       return()
   }
   else {
	  ## some stuff that assigns the edited objects in the calling frame
      return()
   }

This works, but I'd really like to put the return() in the notifyDialog()
function.  Is there an easy way to do this?

Jeff




More information about the R-help mailing list