Re: [R] Size of a refClass instance

2013-05-05 Thread David Kulp
Yes, I agree. How does one conceptually achieve polymorphic behavior without instantiating 100,000s of instances? Perhaps one way around this is to represent the data in an efficient R way -- i.e. a data.frame -- and create a set of re-usable singleton instances of different node types. To pe

Re: [R] Size of a refClass instance

2013-05-03 Thread Jeff Newmiller
Interesting conclusion. Alternatively, that representation of your object model may not be computationally effective. This discrepancy may be less exaggerated in C++, but you may still find that large numbers of objects are less efficient in their use of memory or cpu time than vector processing

Re: [R] Size of a refClass instance

2013-05-03 Thread David Kulp
Good tip. Thanks Morgan. I agree that a different structure might (necessarily) be in order. I wanted to create a tree where nodes in a tree were of different derived sub-classes -- possibly holding more data and behaving polymorphically. OO programming seemed ideal for this: lots of small th

Re: [R] Size of a refClass instance

2013-05-02 Thread Martin Morgan
On 05/01/2013 11:20 AM, David Kulp wrote: I'm using refClass for a complex multi-directional tree structure with possibly 100,000s of nodes. The refClass design is very impressive and I'd love to use it, but I've found that the size of refClass instances are very large and creation time is slow.

[R] Size of a refClass instance

2013-05-01 Thread David Kulp
I'm using refClass for a complex multi-directional tree structure with possibly 100,000s of nodes. The refClass design is very impressive and I'd love to use it, but I've found that the size of refClass instances are very large and creation time is slow. For example, below is a RefClass and no