title: R extract terminal node info from partykit decision tree
body: <p>I have created a constparty decision tree (customized split rules) and print out the tree result. The result looks like this:</p>
  
  <pre><code>Fitted party:
  [1] root
  |   [2] value.a &lt; 1651: 0.067 (n = 1419, err = 88.6)
  |   [3] value.a &gt;= 1651: 0.571 (n = 7, err = 1.7)
  </code></pre>
  
  <p>I am trying to extract terminal node info 
  (the yval: 0.067 and 0.571; 
  the n on each node: 1419 and 7; 
  and err: 88.6 and 1.7) and put them into a list while having the corresponding node id (node ID 2 and 3) so that I can utilize those info later.</p>
  
  <p>I have been looking into partykit functions for a while and could not find a function that could help me extracting those info I just listed.</p>
  
  <p>Could someone help me please?  Thank you!</p>