Skip to content
Prev 307060 / 398503 Next

avoid <<- in specific case

On 05/10/2012 8:19 AM, Berry Boessenkool wrote:
You can return the function as the value of your function.   A bonus:  
if it is created within the body of your function, it will have access 
to all the local variables there.

You shouldn't write to the global environment, because globalenv belongs 
to the user, not to you.  If the user wants your function in the global 
environment s/he can just assign the value of your function to a 
variable there.

Duncan Murdoch