Hello again!
Uwe Ligges' adjustment to my random binary tree recursion
works beautifully. Now I wish to plot the trees. Despite a
careful search, I can't find any plotting routine that will work
with my lists. I've read about "hierarchical clustering" and
"binary dendrograms" in various R packages, but nothing
apparently can take my lists as input.
If anyone has solved this problem and can send me the
relevant code, I will be very thankful! Please e-mail me
at the below address. With much appreciation,
Steve Finch
[EMAIL PROTECTED]
From: Uwe Ligges <[EMAIL PROTECTED]>
To: Steven Finch <[EMAIL PROTECTED]>
CC: r-help@stat.math.ethz.ch
Subject: Re: [R] random binary trees in R
Date: Wed, 29 Nov 2006 18:45:18 +0100
Steven Finch wrote:
Hello!
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))
}
ifelse() is vectorized and evaluates for both cases!
Instead, try:
t <- function(p)
list(if(runif(1) < p) t(p) else 0, if(runif(1) < p) t(p) else 0)
Uwe Ligges
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
[EMAIL PROTECTED]
_________________________________________________________________
All-in-one security and maintenance for your PC. Get a free 90-day trial!
______________________________________________
R-help@stat.math.ethz.ch 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.