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 Michael. On Fri, May 8, 2020 at 2:07 AM Bhagwat, Aditya <[email protected]> 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]] > > _______________________________________________ > [email protected] 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 [email protected] Join Genentech on LinkedIn | Twitter | Facebook | Instagram | YouTube _______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
