Re: [R] get syntax for inherited environments

2013-09-05 Thread Bert Gunter
?sys.parent (and friends) -- Bert On Thu, Sep 5, 2013 at 4:37 PM, ivo welch wrote: > quick question. how do I search up the calling environments until I find a > variable? > > > x=function() { m=22; y() } > > y=function() { z() } > > z=function() { mget("m", inherits=TRUE, ifnotfound="m not f

[R] get syntax for inherited environments

2013-09-05 Thread ivo welch
quick question. how do I search up the calling environments until I find a variable? > x=function() { m=22; y() } > y=function() { z() } > z=function() { mget("m", inherits=TRUE, ifnotfound="m not found") } > x() $m [1] "m not found" from the perspective of z(), function x is not an enclosing en