On Dec 14, 2006, at 7:42 AM, Rainer M Krug wrote:

> myfunc <- function() b <<- 34

I would add a warning here. It is generally not a good idea for a  
function to have side-effects. In this case, if there is a globally  
defined value for b already, it will be overwritten. If this function  
is in a package say, and someone else uses it, or you use it after a  
very long time and have forgotten its internals and the fact that  
it's messing with the Global Environment, this might lead to some  
bugs that are really hard to spot.

> Rainer

Haris

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to