How to use/maintain my S4 class with same name as S4 class in another R package?
I'm writing a large R package that includes an S4 class named 'FeatureSet'. Unfortunately, this is also the name of a virtual S4 class in the widely used 'oligo' package. When I load my package first, and then oligo, and call
new("FeatureSet")
I get the error
Error in new("FeatureSet") :
trying to generate an object from a virtual class ("FeatureSet")
In the NAMESPACE file, I've tried including 'exportClasses' and 'exportClassPattern' to export this S4 definition, or all S4 definitions, from my package without luck. I've also included
exportMethods(coerce, initialize, show)
as I've defined methods for these generics in my package.
Is there a best-practice way to write R code to recognize only a specific S4 definition when multiple definitions with the same name are attached? I could, of course, give my class a different name, but there must be some way to make sure that my classes don't collide with those in some other package in the future. I've spent quite a while looking through the usual forums and documentation and was surprised to see that this question was not answered anywhere. Thanks in advance!