err, wait, sorry.&nbsp; it&#39;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 &lt;<a href="mailto:bolker@zoology.ufl.edu">bolker@zoology.ufl.edu</a>&gt; 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&#39;t have functional SVN access at the moment, otherwise I&#39;d do this<br>
myself. &nbsp;But essentially, calls to &quot;tabulate()&quot; need to define the number of<br>
bins explicitly, otherwise problems occur. &nbsp;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,] &nbsp;1 &nbsp;3<br>
[2,] &nbsp;1 &nbsp;2<br>
[3,] &nbsp;3 &nbsp;4<br>
[4,] &nbsp;3 &nbsp;7<br>
[5,] &nbsp;4 &nbsp;5<br>
[6,] &nbsp;4 &nbsp;6<br>
[7,] &nbsp;7 &nbsp;8<br>
[8,] &nbsp;7 &nbsp;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>
 &nbsp;I grepped for &quot;tabulate&quot;. &nbsp;Are you recommending that<br>
we change all of these usages as above?<br>
(Is it worth defining a &quot;tabedge&quot; function<br>
<br>
tabedge &lt;- function(object,i) {<br>
 &nbsp; &nbsp;tabulate(edges(object[,i]), nbins=nrow(edges(object)))<br>
}<br>
<br>
 &nbsp;to replace most of these, or is that just too complicated?<br>
<br>
 &nbsp;Ben<br>
<br>
<br>
1 checkdata.R: &nbsp; &nbsp;nAncest &lt;- tabulate(edges(object)[, 2])<br>
2 class-phylo4.R: &nbsp; &nbsp;ntips &lt;- sum(tabulate(edge[, 1]) == 0)<br>
3 class-phylo4.R: &nbsp; &nbsp;nnodes &lt;- sum(tabulate(edge[, 1]) &gt; 0)<br>
4 methods-phylo4.R: &nbsp; &nbsp;tabulate(edges(x)[, 1])[nTips(x) + 1] &lt;= 2<br>
5 methods-phylo4.R: &nbsp; &nbsp; &nbsp; &nbsp;temp &lt;- tabulate(E[,1])<br>
6 treestruc.R: &nbsp;degree &lt;- tabulate(edges(object)[, 1])<br>
7 treestruc.R: &nbsp;degree &lt;- tabulate(edges(object)[, 1])<br>
8 treestruc.R:# &nbsp;isTips &lt;- (tabulate(x@edge[,1]) == 0)<br>
9 treestruc.R:# &nbsp;res &lt;- (tabulate(x@edge[,1]) &gt; 2)<br>
<br>
<br>
<br>
<br>
</blockquote></div><br>