title: How to count the observations falling in each node of a tree
body: <p>I am currently dealing with wine data in MMST package. I have split the whole dataset into training and test and build a tree like the following codes:</p>
  
  <pre><code>library("rpart")
  library("gbm")
  library("randomForest")
  library("MMST")
  
  data(wine)
  aux &lt;- c(1:178)
  train_indis &lt;- sample(aux, 142, replace = FALSE)
  test_indis &lt;- setdiff(aux, train_indis)
  
  train &lt;- wine[train_indis,]
  test &lt;- wine[test_indis,]    #### divide the dataset into trainning and testing
  
  model.control &lt;- rpart.control(minsplit = 5, xval = 10, cp = 0)
  fit_wine &lt;- rpart(class ~ MalicAcid + Ash + AlcAsh + Mg + Phenols + Proa + Color + Hue + OD + Proline, data = train, method = "class", control = model.control)
  
  windows()
  plot(fit_wine,branch = 0.5, uniform = T, compress = T,  main = "Full Tree: without pruning")
  text(fit_wine, use.n = T, all = T, cex = .6)
  </code></pre>
  
  <p>And I could get a image like this:
  <img src="https://i.stack.imgur.com/WRrn2.jpg" alt="Tree without pruning"></p>
  
  <p>What does the number under each node (for example 0/1/48 under Grignolino) mean?
  If I want to know how many training and testing sample fall into each node, what should I write in the codes?</p>