[R] list of all methods winthin an S4 class

Martin Morgan mtmorgan at fhcrc.org
Tue Sep 6 15:19:05 CEST 2011


On 09/06/2011 05:50 AM, Albert-Jan Roskam wrote:
> Hello,
>
> How can I generate an overview/vector of all the methods winthin an S4 class? Similar to dir() in this Python code:
>>>> class SomeClass():
>   def some_method_1(self):
>    pass
>   def some_method_2(self):
>    pass
>
>>>> dir(SomeClass)
> ['__doc__', '__module__', 'some_method_1', 'some_method_2']
>>>>

similar to methods(), for a class Foo with methods in Bar use

   showMethods(class="Foo", where=getNamespace("Bar")

Martin

>
> Thanks in advance!
>
> Cheers!!
> Albert-Jan
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 	[[alternative HTML version deleted]]
>
>
>
>
> ______________________________________________
> R-help at 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.


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the R-help mailing list