Skip to content
Prev 69601 / 398525 Next

assigning to a list in a package environment

On May 12, 2005, at 10:09 AM, Gabor Grothendieck wrote:

            
Gabor,

Thanks.  That will do the trick, I think.  Now, just one more question 
as followup if I may?  If I am executing a function that was defined in 
locPkg, how can I determine dynamically what environment I am in?  Them 
I could do something like

myFun <- function (x) {
   # code
   locPkg <- as.environment( .... )
   # more code
}

where '....' is replaced dynamically by the package environment of the 
package in which the function myFun is defined.  The goal is to make 
the code a bit more portable.

Again, thanks for the help.

Sean