[Rd] 3 minor issues with getClass 'resolve.msg' arg

Hervé Pagès hpages at fredhutch.org
Sun Jun 26 22:21:00 CEST 2016


Hi,

It turns out that two packages (1 Bioconductor, 1 CRAN) define an
S4 class called "Annotated":

   library(S4Vectors)  # see (*) at bottom for how to install
   library(RNeXML)

1st issue
---------

getClass() issues the same warning twice:

   tmp <- getClass("Annotated")
   Found more than one class "Annotated" in cache; using the first, from 
namespace 'S4Vectors'
   Found more than one class "Annotated" in cache; using the first, from 
namespace 'S4Vectors'

2nd issue
---------

It would be very helpful if the warning message was giving the name of
the other package. I was in a session with 50+ packages attached or
loaded via a namespace when I saw the warning. Took me a while to
identify the other package, which I finally managed to do with:

   names(.Call(methods:::C_R_getClassFromCache, "Annotated", 
methods:::.classTable))

3rd issue
---------

Calling getClass() with 'resolve.msg=FALSE' only removes one of the 2
warnings:

   > tmp <- getClass("Annotated", resolve.msg=FALSE)
   Found more than one class "Annotated" in cache; using the first, from 
namespace 'S4Vectors'

Thanks,
H.

(*) Install S4Vectors with:

   source("https://bioconductor.org/biocLite.R")
   biocLite("S4Vectors")

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the R-devel mailing list