[R] How to express a tree?

Jim Lemon jim at bitwrit.com.au
Tue Oct 27 23:45:10 CET 2009


On 10/28/2009 04:06 AM, Hesen Peng wrote:
> Hello everybody,
>
> I'm write a function whose output represents a tree. Can anyone please
> recommend me some data structure in R which are good for expressing a
> tree? The possible idea I'm having in my mind is to represent the
> whole tree as a list in which a sublist (an element to the main list)
> contains all its corresponding branches. Is there any simpler way of
> doing this? Thank you very much.
>    
Hi Hesen,
This is the approach used in the listBuilder function in the crank 
package. It may be of use to you.

Jim




More information about the R-help mailing list