Re: [R] return from nested function?

From: Seth Falcon <sfalcon_at_fhcrc.org>
Date: Wed 02 Mar 2005 - 18:21:44 EST

On Feb 25, 2005, at 12:34 PM, jhallman@frb.gov wrote:

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

This snippet may be of interest:

> f = function(x) {

+ print("f")
+ g(return())
+ print("end of f")
+ }

> g=function(x) {print("g")

+ x
+ print("end of g")
+ }

> f(1)

[1] "f"
[1] "g"
NULL



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 Wed Mar 02 18:28:46 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 01:35:44 EST