isClass
tests for a class;
findClass
returns the name(s) of packages containing the
class; getClasses
returns the names of all the classes in an
environment, typically a namespace. To examine the definition of a class, use getClass
.isClass(Class, formal=TRUE, where)getClasses(where, inherits = missing(where))
findClass(Class, where, unique = "")
## The remaining functions are retained for compatibility
## but not generally recommended
removeClass(Class, where)
resetClass(Class, classDef, where)
sealClass(Class, where)
packageSlot
of the character string.environment
in which to search for
the class definition. Defaults to the top-level environment of the
calling function. When called from the command line, this has the
effect of using all the package environments in the search list. To restrict the search to classes in a particular package, use where =
asNamespace(pkg)
with pkg
the package name; to restrict
it to
the exported classes, use where = "package:pkg"
after the
package is attached to the search list.
logical
is a formal definition
required? For S compatibility, and always treated as TRUE
.findClass
expects a unique location for the
class, unique
is a character string explaining the purpose
of the search (and is used in warning and error messages). By
default, multiple locations are possible and the function always
returns a list.
getClasses
, should the value
returned include all parent environments of where
, or that
environment only? Defaults to TRUE
if where
is
omitted, and to FALSE
otherwise.
resetClass
, the optional class
definition.
isClass
:getClasses
:where
. If
called with no argument, all the classes visible from the
calling function (if called from the top-level, all the classes
in any of the environments on the search list). The
where
argument is used to search only in a particular package.
findClass
:Class
is found. If
where
is supplied, a list is still returned, either empty
or containing the environment corresponding to where
.
By default when called from the R session, the global
environment and all the currently
attached packages are searched. If unique
is supplied as a character string,
findClass
will warn if there is more than one definition
visible (using the string to identify the purpose of the call),
and will generate an error if no definition can be found. The remaining functions are retained for
back-compatibility and internal use, but not generally recommended.
removeClass
:resetClass
:sealClass
:getClass
,
Classes_Details
,
Methods_Details
,
makeClassRepresentation