Usage
## S3 method for class 'Object}(this, ...className, ..., ...fields=NULL)':
extendundefined
- ...className
{The name of new class.}
- ...
{Named values representing the fields of the new instance.}
- ...fields
{An optional named list
of fields. This makes it possible
to specify a set of fields using a list
object.}
Returns an Object of class className
.
The reason for the strange name of argument "...className"
is that
if one tries to set a field with a name that is a prefix of the name of
this arguments and one at the same time does not specify the name of this
argument one would run into strange errors. For instance, try
extend(Object(), "MyClass", ...c=0)
.
{
It is possible to specify modifiers to some of the fields. Currently it
is only the cached
modifier that is recognized. A field that is
cached will be assigned NULL
when *clearCache()
(or *gc()
) is called. To specify a modifier, append a comma
separated list of modifiers followed by a colon, e.g. "cached:foo".
}
For a complete example see help(Object).
[object Object]
For more information see Object
.
programming
methods
internal
methods