Hi R gurus, here I am trying to understand how R define and work with the
"prototype" property in class definition. Here I have created a class:
> setClass("a", representation=list(x="numeric",
y="character"))
[1] "a"
As I did not explicitly define the prototype in above code, R is supposed to
generate default. I wanted to see what R generated:
> prototype("a")
An object of class "classPrototypeDef"
Slot "object":
[1] "a"
Slot "slots":
character(0)
Slot "dataPart":
[1] TRUE
I really could not understand the meaning which R returned. I understood
part of above (please correct me if I am wrong):
"An object of class "classPrototypeDef"" : I understood R
treats the
prototype of any class, as an object of class "classPrototypeDef"
"Slot "object":" : I believe under this heading, R shows the
name of the
underlying class, whose prototype I am looking for
"Slot "slots":" : I really could not understand what this
meant for
"Slot "dataPart":" : again I really could not understand
what this meant for
Can anyone please help me to understand above clearly?
Thanks and regards,
[[alternative HTML version deleted]]