R: Scope of variables within user defined functions
Variables declared inside a function are local to that function. For instance:
gives the following error: .
In this case is accessible from outside the function.
However, unlike C, C++ or many other languages, brackets do not determine the scope of variables. For instance, in the following code snippet:
remains accessible after the statement.