Skip to content
Prev 45615 / 63424 Next

how to control the environment of a formula

On 13-04-18 11:39 AM, Thomas Alexander Gerds wrote:
It's not really that hard.  Use names <- ls() in the function to get a 
list of all of them; remove the names of variables that might be needed 
in the formula (and the name of the formula itself); then use 
rm(list=names) to delete everything else just before returning it.

Duncan Murdoch