Because, as that help page makes clear, the 'parent environment' is easily confused with the 'parent frame', we tend not to use the former.

So the main answer to

when/how is the the parent environment distinct from the enclosing environment?

is 'when the writer meant the parent frame'.

On Mon, 7 Feb 2011, Joshua Wiley wrote:

On Mon, Feb 7, 2011 at 9:40 AM, Bert Gunter <gunter.ber...@gene.com> wrote:
On Mon, Feb 7, 2011 at 9:21 AM, Joshua Wiley <jwiley.ps...@gmail.com> wrote:
Hi,
When a function cannot find a variable inside its own environment, it
will look to its parent environment.


This is false. It will "look to" its **enclosing environment" /
"enclosure" . See
?environment

Thank you for the correction, Bert.  I had always interpreted:

"If one follows the 'parent.env()' chain of enclosures back far
enough from any environment, eventually one reaches the empty
environment."

to mean the parent environment was basically synonymous with the
enclosure.  I re-read ?environment, but I think I am still missing
something, so if I may ask a follow up question, would you explain or
suggest additional places to look for when/how is the the parent
environment distinct from the enclosing environment?

Thanks,

Josh

(Note: This is fundamental to R scoping)

-- Bert

--
Bert Gunter
Genentech Nonclinical Biostatistics

______________________________________________
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.


--
Brian D. Ripley,                  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
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.

Reply via email to