Skip to content
Prev 16767 / 21312 Next

[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

Michael.

On Fri, May 8, 2020 at 2:07 AM Bhagwat, Aditya
<Aditya.Bhagwat at mpi-bn.mpg.de> wrote: