[R] Function does not see variables outside the function

Rui Barradas ruipbarradas at sapo.pt
Tue Nov 5 13:25:10 CET 2013


Hello,

I believe the answer is no. Functions will first look in their 
environment, and then in the parent frame, i.e., outside the function.

Hope this helps,

Rui Barradas

Em 05-11-2013 10:42, Zhong-Yuan Zhang escreveu:
> Dear experts:
>
>       In MATLAB, functions cannot see variables outside the
>
> functions.  However, in R, the functions can do that. Is there
>
> any settings that can disable this ability of functions?
>
>       Many thanks for your kind help.
>
>       Best Regards Always.
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list