[R] random binary trees in R

Steven Finch sfinch9 at hotmail.com
Wed Nov 29 18:26:25 CET 2006


I wish to generate random binary trees in R.
Unfortunately recursive code like:

t <- function(p)
   list(ifelse(runif(1)<p,t(p),0), ifelse(runif(1)<p,t(p),0))

does not seem to work. Has anyone ever
performed such a simulation?  I would like
to see their code.  Maybe this is not feasible
in R.  Please e-mail me at the below address
(since I am not yet a subscriber to this list).
Thank you!

Steve Finch
sfinch9 at hotmail.com

MSN Shopping has everything on your holiday list. Get expert picks by style, 
age, and price. Try it!

More information about the R-help mailing list