Update index.md (#33151)

This commit is contained in:
Josh Goldberg
2019-03-04 18:04:18 -06:00
committed by Randell Dawson
parent 1236847518
commit 1c272a05cd

View File

@ -7,9 +7,7 @@ A function allows you to define a reusable block of code that can be executed ma
Functions can be named and called repeatedly or can be run anonymously in place (similar to lambda functions in python). Functions can be named and called repeatedly or can be run anonymously in place (similar to lambda functions in python).
Developing a full understanding of R functions requires understanding of environments. Developing a full understanding of R functions requires understanding of environments.
Environments are simply a way to manage objects. An example of environments in action is that you can use a redundant variable Environments are simply a way to manage objects. An example of environments in action is that you can use a redundant variable name within a function, that won't be affected if the larger runtime already has the same variable. Additionally, (lexical scoping)[https://en.wikipedia.org/wiki/Scope_(computer_science)#Lexical_scoping] is used when a function calls a variable not defined within the function it will check the higher level environment for that variable.
name within a function, that won't be affected if the larger runtime already has the same variable. Additionally, if a
function calls a variable which is not defined within the function, it will check the higher level environment for that variable.
### Syntax ### Syntax