[R] A question regarding R scoping

Ivo Shterev idc318 at yahoo.com
Wed Aug 5 23:55:24 CEST 2009

I have a question related to scoping. Suppose we have 2 functions:

f1 = function(i){i = 1}

f2 = function(n){ 
 i = length(n)

In other words, I would like i=1 regardless of n. Is this possible without having f1 in the body of f2? Thanks in advance!

More information about the R-help mailing list