Re: [R] function environment

2006-06-03 Thread Martin Maechler
Roger == Roger D Peng [EMAIL PROTECTED] on Fri, 02 Jun 2006 13:03:12 -0400 writes: Roger Try Roger save(A, B, file = myfun.r) Roger attach(myfun.r) Roger Your functions will be on the search list. yes. But do yourself (and your readers/users/..) a favor by using a

[R] function environment

2006-06-02 Thread Matthias Braeunig
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, how can I automatically access the functions that I loaded into a separate environment? save(A,B,file=myfun.r) load(myfun.r,envir=(ENV-new.env())) ls(ENV) [1] A B ?[ turned up that I can access the functions via ENV$A function () { }

Re: [R] function environment

2006-06-02 Thread Gabor Grothendieck
Try this: attach(as.list(ENV)) search() # shows it on the path A function's environment refers to where variables in the function are looked for if they can't find the variable in the function itself. The environment in which a function itself is located is entirely different. e.g. a - 1 e -

Re: [R] function environment

2006-06-02 Thread Prof Brian Ripley
On Fri, 2 Jun 2006, Matthias Braeunig wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, how can I automatically access the functions that I loaded into a separate environment? This is a topic that is probably best suited to R-devel: the explanations are going to get technical, and

Re: [R] function environment

2006-06-02 Thread Roger D. Peng
Try save(A, B, file = myfun.r) attach(myfun.r) Your functions will be on the search list. -roger Matthias Braeunig wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, how can I automatically access the functions that I loaded into a separate environment? save(A,B,file=myfun.r)