title: How to print out a rpart tree result in text in Rshiny
body: <p>You can easily print out an rpart tree result in text in R console with the following command. </p>
  
  <pre><code>fit &lt;- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
  print(fit)
  </code></pre>
  
  <p>And it prints out:</p>
  
  <blockquote>
    <p>n= 81 </p>
    
    <p>node), split, n, loss, yval, (yprob)
          * denotes terminal node</p>
    
    <p>1) root 81 17 absent (0.79012346 0.20987654)      2) Start>=8.5 62  6
    absent (0.90322581 0.09677419)<br>
         4) Start>=14.5 29  0 absent (1.00000000 0.00000000) *
         5) Start&lt; 14.5 33  6 absent (0.81818182 0.18181818)<br>
          10) Age&lt; 55 12  0 absent (1.00000000 0.00000000) *
          11) Age>=55 21  6 absent (0.71428571 0.28571429)<br>
            22) Age>=111 14  2 absent (0.85714286 0.14285714) *
            23) Age&lt; 111 7  3 present (0.42857143 0.57142857) *    3) Start&lt; 8.5 19  8 present (0.42105263 0.57894737) *</p>
  </blockquote>
  
  <p>However, this does not work in Rshiny textOutput.<br>
  See the following Rshiny Code:</p>
  
  <p>ui.r</p>
  
  <pre><code>library(shiny)
  
  # Define UI for application that draws a histogram
  shinyUI(fluidPage(
  
    # Application title
      # Show a plot of the generated distribution
      mainPanel(
        plotOutput("distPlot"),
        textOutput("distText")
      )
    )
  )
  </code></pre>
  
  <p>server.r</p>
  
  <pre><code>library(shiny)
  library(rpart)
  # Define server logic required to draw a histogram
  shinyServer(function(input, output) {
    output$distText &lt;- renderText({
      fit &lt;- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
      print(fit)
    })
  })
  </code></pre>
  
  <p>If I run the above shiny APP, it give the following error:</p>
  
  <blockquote>
    <p>Error in cat(list(...), file, sep, fill, labels, append) :<br>
    argument 1 (type 'list') cannot be handled by 'cat'</p>
  </blockquote>