Hi,
I am trying to create a linked list in R by defining a class Node which has a
instance variable Node.
setClass("Node", representation(rate="numeric", nextNode="ANY"))
The above works. But the following gives me a warning message.
setClass("Node", representation(rate="numeric", nextNode="Node"))
>
> setClass("Node", representation(rate="numeric", nextNode="ANY"))
[1] "Node"
> removeClass("Node")
[1] TRUE
>
> setClass("Node", representation(rate="numeric", nextNode="Node"))
[1] "Node"
Warning message:
undefined slot classes in definition of "Node": nextNode(class "Node")
>
In the case when nextNode is type Node, is it possible to get ride of the above
"undefined slot classes" warning message ?
Thanks in advance for any assistance!
Shing
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.