err, wait, sorry. it's not nrows() we want, but max(edge) ...<br><br>-Aaron<br><br><div class="gmail_quote">On Wed, May 21, 2008 at 11:35 AM, Ben Bolker <<a href="mailto:bolker@zoology.ufl.edu">bolker@zoology.ufl.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c"><br>
<br>
<br>
Aaron Mackey wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I don't have functional SVN access at the moment, otherwise I'd do this<br>
myself. But essentially, calls to "tabulate()" need to define the number of<br>
bins explicitly, otherwise problems occur. For example:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
edge<br>
</blockquote>
[1,] 1 3<br>
[2,] 1 2<br>
[3,] 3 4<br>
[4,] 3 7<br>
[5,] 4 5<br>
[6,] 4 6<br>
[7,] 7 8<br>
[8,] 7 9<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
tabulate(edge[,1])<br>
</blockquote>
[1] 2 0 2 2 0 0 2<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
tabulate(edge[,1], nbins=dim(edge)[1])<br>
</blockquote>
[1] 2 0 2 2 0 0 2 0<br>
<br>
-Aaron<br>
<br>
</blockquote>
<br></div></div>
I grepped for "tabulate". Are you recommending that<br>
we change all of these usages as above?<br>
(Is it worth defining a "tabedge" function<br>
<br>
tabedge <- function(object,i) {<br>
tabulate(edges(object[,i]), nbins=nrow(edges(object)))<br>
}<br>
<br>
to replace most of these, or is that just too complicated?<br>
<br>
Ben<br>
<br>
<br>
1 checkdata.R: nAncest <- tabulate(edges(object)[, 2])<br>
2 class-phylo4.R: ntips <- sum(tabulate(edge[, 1]) == 0)<br>
3 class-phylo4.R: nnodes <- sum(tabulate(edge[, 1]) > 0)<br>
4 methods-phylo4.R: tabulate(edges(x)[, 1])[nTips(x) + 1] <= 2<br>
5 methods-phylo4.R: temp <- tabulate(E[,1])<br>
6 treestruc.R: degree <- tabulate(edges(object)[, 1])<br>
7 treestruc.R: degree <- tabulate(edges(object)[, 1])<br>
8 treestruc.R:# isTips <- (tabulate(x@edge[,1]) == 0)<br>
9 treestruc.R:# res <- (tabulate(x@edge[,1]) > 2)<br>
<br>
<br>
<br>
<br>
</blockquote></div><br>