Hi Martin,
 
Great, the second solution is precisely what I've been looking for. Thanks a 
lot!

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?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- On Thu, 5/20/10, Martin Morgan <mtmor...@fhcrc.org> wrote:


From: Martin Morgan <mtmor...@fhcrc.org>
Subject: Re: [R] getSubClasses()?
To: "Albert-Jan Roskam" <fo...@yahoo.com>
Cc: "R Mailing List" <r-help@r-project.org>
Date: Thursday, May 20, 2010, 4:58 PM


On 05/20/2010 07:47 AM, Albert-Jan Roskam wrote:
> Hi,
> 
> Is there a built in function that returns a character vector of all
> subclasses of a given superclass? showClass(Class = "SomeClass")
> contains the info that I want, but I don't know how to access it. 

Hi Albert-Jan --

Maybe

> slotNames(class(getClass("vector")))
[1] "slots"      "contains"   "virtual"    "prototype"  "validity"
[6] "access"     "className"  "package"    "subclasses" "versionKey"
[11] "sealed"
> names(getClass("vector")@subclasses)
[1] "logical"            "numeric"            "character"
[4] "complex"            "integer"            "raw"
[7] "expression"         "list"               "structure"
[10] "array"              "matrix"             "signature"
[13] "ObjectsWithPackage" "mts"                "ordered"
[16] "namedList"          "listOfMethods"

Martin

> getSubClasses <- function(superClass)
> return(setdiff(getClasses(.GlobalEnv), superClass)) wíll only work if
> the global enviroment isn;t filled with other class definitions.
> 
> I've seen functions that somewhat resemble it, but are not quite the
> same. 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@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.


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

Location: Arnold Building M1 B861
Phone: (206) 667-2793



      
        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to