title: How to tell if a ctree is just a root node?
body: <p>Say I fit a model like this:</p>
  
  <pre><code>ctree(Age ~ Kyphosis, data = kyphosis, mincriterion = 1)
  </code></pre>
  
  <p>How could I get the number of splits? How could I get whether it were just a root node?</p>
  
  <p>EDIT:</p>
  
  <p>Packages used:</p>
  
  <pre><code>library(caret)
  library(party)
  library(partykit)
  library(plyr)
  library(xtable)
  </code></pre>
  
  <p>Error when I try to use <code>tree.size</code> as listed in answer below:</p>
  
  <pre><code>&gt; tree.size(ctree(Age ~ Kyphosis, data = kyphosis, mincriterion = 1)@tree)
  Error in tree.size(ctree(Age ~ Kyphosis, data = kyphosis, mincriterion = 1)@tree) : 
    trying to get slot "tree" from an object (class "constparty") that is not an S4 object 
  </code></pre>