Re: [Rd] Getting hold of a package's environment from C code

2006-10-23 Thread Deepayan Sarkar
On 10/23/06, Luke Tierney <[EMAIL PROTECTED]> wrote: > On Mon, 23 Oct 2006, Prof Brian Ripley wrote: > > > As far as I can tell from the original post, Deepayan asked for a way > > to find a package's namespace environment (rather than the package > > environment, not ), so the subject line is > >

Re: [Rd] Getting hold of a package's environment from C code

2006-10-23 Thread Luke Tierney
On Mon, 23 Oct 2006, Prof Brian Ripley wrote: > As far as I can tell from the original post, Deepayan asked for a way > to find a package's namespace environment (rather than the package > environment, not ), so the subject line is > subject to misinterpretation. > > On Mon, 23 Oct 2006, Prof Bri

Re: [Rd] Getting hold of a package's environment from C code

2006-10-23 Thread Luke Tierney
On Mon, 23 Oct 2006, Prof Brian Ripley wrote: > On Sun, 22 Oct 2006, Seth Falcon wrote: > >> Seth Falcon <[EMAIL PROTECTED]> writes: >>> Perhaps: >>> >>> R_FindNamespace(mkString(where)) >> >> Sorry, this won't help you for package-level code as this function is >> part of the internal use only AP

Re: [Rd] Getting hold of a package's environment from C code

2006-10-23 Thread Prof Brian Ripley
As far as I can tell from the original post, Deepayan asked for a way to find a package's namespace environment (rather than the package environment, not ), so the subject line is subject to misinterpretation. On Mon, 23 Oct 2006, Prof Brian Ripley wrote: > On Sun, 22 Oct 2006, Seth Falcon wr

Re: [Rd] Getting hold of a package's environment from C code

2006-10-23 Thread Prof Brian Ripley
On Sun, 22 Oct 2006, Seth Falcon wrote: > Seth Falcon <[EMAIL PROTECTED]> writes: >> Perhaps: >> >> R_FindNamespace(mkString(where)) > > Sorry, this won't help you for package-level code as this function is > part of the internal use only API. It would be nice to have access to > it or a similar

Re: [Rd] Getting hold of a package's environment from C code

2006-10-22 Thread Prof Brian Ripley
On Sun, 22 Oct 2006, Deepayan Sarkar wrote: > On 10/22/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: >> On 10/22/2006 3:56 PM, Deepayan Sarkar wrote: >>> Hi, >>> >>> I have a package where I'm calling an R function (say "foo") from C >>> code. "foo" is in the same package, but is not exported. I c

Re: [Rd] Getting hold of a package's environment from C code

2006-10-22 Thread Seth Falcon
Seth Falcon <[EMAIL PROTECTED]> writes: > Perhaps: > > R_FindNamespace(mkString(where)) Sorry, this won't help you for package-level code as this function is part of the internal use only API. It would be nice to have access to it or a similar function from C in package code. ___

Re: [Rd] Getting hold of a package's environment from C code

2006-10-22 Thread Seth Falcon
"Deepayan Sarkar" <[EMAIL PROTECTED]> writes: > On 10/22/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: >> In R code, you could use getNamespace("pkg") to get the namespace >> environment. I haven't tried this, but I'd assume >> >> PROTECT(rho = eval(lang2(install("getNamespace"), >>

Re: [Rd] Getting hold of a package's environment from C code

2006-10-22 Thread Duncan Murdoch
On 10/22/2006 3:56 PM, Deepayan Sarkar wrote: > Hi, > > I have a package where I'm calling an R function (say "foo") from C > code. "foo" is in the same package, but is not exported. I construct > the call using lang1(install("foo")), but to eval it I need the > package's environment. Is there a

[Rd] Getting hold of a package's environment from C code

2006-10-22 Thread Deepayan Sarkar
Hi, I have a package where I'm calling an R function (say "foo") from C code. "foo" is in the same package, but is not exported. I construct the call using lang1(install("foo")), but to eval it I need the package's environment. Is there a way to do this? Passing the correct environment through .C

Re: [Rd] Getting hold of a package's environment from C code

2006-10-22 Thread Deepayan Sarkar
On 10/22/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 10/22/2006 3:56 PM, Deepayan Sarkar wrote: > > Hi, > > > > I have a package where I'm calling an R function (say "foo") from C > > code. "foo" is in the same package, but is not exported. I construct > > the call using lang1(install("foo")