[Bioc-devel] How to import a setAs method in one's package?

Bhagwat, Aditya Ad|ty@@Bh@gw@t @end|ng |rom mp|-bn@mpg@de
Sat May 9 11:10:35 CEST 2020

Thankyou guys for your quick and helpful feedback!

From: Michael Lawrence [lawrence.michael using gene.com]
Sent: Friday, May 08, 2020 7:35 PM
To: Bhagwat, Aditya
Cc: bioc-devel using r-project.org
Subject: Re: [Bioc-devel] How to import a setAs method in one's package?

setAs() defines methods on the coerce() generic, so you could write
importMethodsFrom(pkg, coerce). However, as() searches the namespace
associated with class(from) for coerce() methods. As long as that
namespace hasn't selectively imported methods on coerce(), it should
end up using the global table and find the appropriate method.

It's best to just importFrom() a generic to get access to its global
table, or import() the entire package. So Hervé's suggestion of
import(methods) is the right way to go


On Fri, May 8, 2020 at 2:07 AM Bhagwat, Aditya
<Aditya.Bhagwat using mpi-bn.mpg.de> wrote:
> Dear BioC compatriots,
> How does one import a setAs method (which is generally not exported)?
> I in particular need to import as(., DataFrame) and am a bit puzzled on how to do this.
> Thank you!
> Aditya
>         [[alternative HTML version deleted]]
> _______________________________________________
> Bioc-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

Michael Lawrence
Senior Scientist, Bioinformatics and Computational Biology
Genentech, A Member of the Roche Group
Office +1 (650) 225-7760
michafla using gene.com

Join Genentech on LinkedIn | Twitter | Facebook | Instagram | YouTube

More information about the Bioc-devel mailing list