>> How to find the package of a class given classname? >> For example, there is a class called GAlignments, I want to do something >> like >> 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 > programmatically. > > 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") > [1] "GenomicRanges"
Or maybe findClass? > > Otherwise, if the package in question is installed but not attached > you can still do: > > ??`GAlignments-class` Or class?GAlignments Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.