environment problems

Hello,

I realize this is not a new problem, but I'm hoping somebody can point me in the right direction. 

The function silly() below calls gam() (from package gam) with different values of the span parameter for
lo(), which is used inside the formula of gam. The values for span are stored in a vector that resides in the
function silly(), and that lo(), for some reason, needs to see.

A hack to get around this is provided in silly2(), where the current value for span is forcefully assigned to
a variable in the "top" environment, that is always visible (I believe?) Of course, this is not good
programming practice (to say the least).

I'd very much appreciate it if somebody could help me find a better way to make silly() work.

Thanks a lot in advance.

Matias

-----------------------------
> version
               _                           
platform       i386-redhat-linux-gnu       
arch           i386                        
os             linux-gnu                   
system         i386, linux-gnu             
status                                     
major          2                           
minor          7.1                         
year           2008                        
month          06                          
(Continue reading)


Gmane