[R] return from nested function?

From: <jhallman_at_frb.gov>
Date: Sat 26 Feb 2005 - 07:34:20 EST


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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Feb 26 07:52:37 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 01:34:38 EST