title: R package "tree": how to control the maximum tree depth?
body: <p>The R package "tree" restricts the maximum tree depth to 31.  If the function <code>tree</code> is applied to a large dataset, this limit is easily reached:</p>
  
  <pre><code>&gt; library("tree")
  &gt; library("ElemStatLearn")
  &gt; data &lt;- list(image=as.matrix(zip.train[,-1]), digit=as.factor(zip.train[,1]))
  &gt; t &lt;- tree(digit~image, data, split="gini")
  Error in tree(digit ~ image, data, split = "gini") : 
    maximum depth reached
  Calls: source -&gt; withVisible -&gt; eval -&gt; eval -&gt; tree -&gt; .C
  </code></pre>
  
  <p>Is there a way to tell <code>tree</code> to just stop growing the tree when the maximum tree depth is reached, rather than aborting with an error?
  (In other words: is there an equivalent for the <code>maxdepth</code> parameter of <code>rpart.control</code>?)</p>