Scoping

http://en.wikipedia.org/wiki/Scope_%28computer_science%29
Lexical (static) vs. Dynamic

Screenshot from 2013-10-05 12:07:16

The global variable y is 10, unless it is called within the function f, where it is defined as 2.

Robert Gentleman and Ross Ihaka (2000). “Lexical Scope and
Statistical Computing,” JCGS, 9, 491–508. Available at: https://www.stat.auckland.ac.nz/~ihaka/downloads/lexical.pdf

Advertisements

About Lisa Cohen

PhD student at UC Davis.
This entry was posted in Coursera, R. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s