Re: [R] source() vs attach()0

2009-11-11 Thread Stefan Zeugner
Duncan Murdoch wrote: Just declaring it there is the only reasonable way, i.e. test-function(foo) { subtest - function() { foo - foo+1 } subtest() return(foo) } The reason you can't somehow assign it within an existing test is that subtest is a different closure every time. Its

[R] source() vs attach()0

2009-11-10 Thread Stefan Zeugner
Hello, After hours of googling I could not resolve the following (although it seems simple): I would like to put subfunctions in a separate .R file that is then called with source() from inside several main functions. A crude example would be as follows: file subtest.R **