[R] Find the package of a class given classname
h.wickham at gmail.com
Mon Jan 13 15:42:09 CET 2014
>> How to find the package of a class given classname?
>> For example, there is a class called GAlignments, I want to do something
>> attr("GAlignments", "package") that gives you the package where the class
>> is defined? But of course, attr("GAlignments", "package") won't work...
> You didn't say whether you wanted to be able to do this
> If that's the case maybe you're lucky and the package where the class
> is defined is already attached to your session. In that case:
> > attr(class(new("GAlignments")), "package")
>  "GenomicRanges"
Or maybe findClass?
> Otherwise, if the package in question is installed but not attached
> you can still do:
More information about the R-help