whichSubclasses: Find Selected Subclasses of a Class

Description Usage Arguments Value Author(s) Examples

Description

Returns the names of subclasses of a given class, restricted optionally to those of a particular distance (especially 1 for direct subclasses) and to those that are or are not simple extensions. showVectorTypes is just an example that prints all the types of all the basic vector classes.

Usage

1
2
whichSubclasses(Class, distance = NA, simple = NA)
showVectorTypes(withClasses)

Arguments

Class

The name of the class or its formal definition, as returned by getClass().

distance

The range of distance (1 == direct subclasses, 2 == their direct subclasses, etc.). By default, no restriction.

simple

Should these be simple subclasses, that is, those created by the contains= argument, without any explicit function to extract or replace the superclass? Legal values: NA (no restriction); TRUE or FALSE.

withClasses

In showVectorTypes(), should the corresponding clases be printed?

Value

The character vector of names of the selected subclasses.

Author(s)

John Chambers

Examples

1
2
3
## the essential implementation of showVectorTypes()
classes <- whichSubclasses("vector", distance = 1, simple = TRUE)
sapply(classes, function(x) typeof(new(x)))

johnmchambers/XRtools documentation built on May 19, 2019, 5:16 p.m.