| ClassDefinition-class | R Documentation |
These classes are used to represent pending or would-be
R class definitions for DCOM interfaces.
These are converted into actual commands to define R classes
when the code is written via writeCode
to a file for use in future R sessions.
So these are not class definitions directly, but
representation of information about how to define
particular classes.
ClassDefinition is a virtual class.
This provides a slot inherited by the other two classes
giving the name of the new class to be defined.
NamedClassDefinition is a simple class
that contains information about the names of the
class(es) that the new class extends.
InlinedClassDefinition uses a slightly different
representation, which is the R command (as a string)
that defines the class. This allows it to
include more complex structure in the setClass
command such as a prototype.
The function classDefinitionString is
used to convert an instance these classes
into a string (a character vector of length 1)
that can be used within code to define the class.
Objects can be created by calls of the form
new("InlineClassDefinition", ...)
and new("NamedClassDefinition").
code:Object of class "character".
For NamedClassDefinition,
this is a character vector giving
the name of the new class being defined,
and the class(es) that it contains.
This is conveted into a definition as
setClass(x@className, contains = x@code[2]),
so currently only the second element is really used.
For InlineClassDefinition, again the className
gives the name of the new class being defined.
The code slot is a string that gives the
R command to define the new class. As such, it is entirely
free form but must evaluate correctly when parsed and evaluated
by the R interpreter.
className:Object of class "character".
This is a string (i.e. vector of length 1) that gives the
name of the new class being defined.
No methods defined with class "ClassDefinition" in the signature.
Duncan Temple Lang <duncan@wald.ucdavis.edu>
http://msdn.microsoft.com/library http://www.omegahat.org/RWinTypeLibs
classDefinitionString
generateInterface
getListClassName
computeClassName
new("NamedClassDefinition",
className = "Workbook",
code = "CompiledCOMIDispatch")
cmd = "setClass('Workbooks', contains = 'COMNamedTypedList',
prototype = list(name = '_Workbook'))"
new("InlineClassDefinition",
className = "Workbooks",
code = cmd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.