[R] R - S compatibility table

Douglas Bates bates at stat.wisc.edu
Tue Oct 21 23:57:25 CEST 2003


David Brahm  <brahm at alum.mit.edu> writes:

> Language differences:
> - Scoping rules differ.  In R, functions see the functions they're in.  Try:
>     f1 <- function() {x <- 1; f2 <- function() print(x); f2()};  f1()

It may be more accurate to say "the functions they're defined in".
It's lexical scoping, not dynamic scoping.




More information about the R-help mailing list