Skip to content
Prev 27340 / 63424 Next

experiments with slot functions and possible problems NOTE

If the intention is to place fList's contents in the global environment
then you need to specify that in addtoenv or else it assumes
the parent environment.
$foo
function() {
   1:10
  }

$bar
function() {
    log(foo())
  }
[1]  1  2  3  4  5  6  7  8  9 10
[1] 0.0000000 0.6931472 1.0986123 1.3862944 1.6094379 1.7917595 1.9459101
 [8] 2.0794415 2.1972246 2.3025851

Note that this takes advantage of the fact that in your example flistA was
defined in the global environment in the first place.  Had that not been the
case we would have had to reset the environment of bar so that it could
find foo.

By the way.  What about just attach(flistA) ?
On Jan 21, 2008 8:30 AM, Thomas Petzoldt <Thomas.Petzoldt at tu-dresden.de> wrote: