[R] follow up on "[Rd] NAMESPACE & methods guidance, please" ( http://tolstoy.newcastle.edu.au/R/e4/devel/08/06/1901.html )

Tao Shi shitao at hotmail.com
Wed Oct 8 02:13:18 CEST 2008


This is a follow-up on the discussion originally posted on the R-devel list ( http://tolstoy.newcastle.edu.au/R/e4/devel/08/06/1901.html ), as I have encountered the exact same issue mentioned in Martin's email.   Here is a simplified version of my problem:


##=================================================================
## I created a package, say, "tmpA", with a NAMESPACE with Depend: and Imports: org.Hs.eg.db and in a new session of R

> library(tmpA)
> foo

function ()
{

    require("org.Hs.eg.db")
    get("A GO TERM", org.Hs.egGO2ALLEGS)
}


> foo()

Error in as.environment(pos) : invalid object for 'as.environment' 
##=================================================================


I fixed the problem by changing "get" explicitly to "AnnotationDbi::get".  I'm just wondering what was the final decision on the problem and if there are more elegant ways of handling this.

Thanks,

...Tao



_________________________________________________________________


50F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008


More information about the R-help mailing list