title: R shiny dashboard infobox with a dataset input
body: <p>I am new to <a href="/questions/tagged/r" class="post-tag" title="show questions tagged &#39;r&#39;" rel="tag">r</a> and shiny and suspect that I am stuck with a simple problem.</p>
  
  <p>I want 2 infoboxes which show me in one the maximum amount over all categories and in the second infobox only the category with the most amount and its total amount.</p>
  
  <p>I have tried a lot of things but nothing brought me success.</p>
  
  <pre><code>## app.R ##
  library(shiny)
  library(shinydashboard)
  
  ui &lt;- dashboardPage(
    dashboardHeader(),
    dashboardSidebar(),
    dashboardBody(
  
      uiOutput("info_box1"),
      uiOutput("info_box2"),
      uiOutput("rawdata")
    )
  )
  
  set.seed(24)
  mydf &lt;- data.frame(Type = sample(LETTERS[1:5], 30, replace = TRUE),
                     Amount = sample(10:200, 30, replace = TRUE), 
                     stringsAsFactors= FALSE, check.names = FALSE)
  
  
  server &lt;- function(input, output) {
  
    output$info_box1 &lt;- renderUI({
      infoBox("Amount in Total here", input$ "???")
    })
  
    output$info_box2 &lt;- renderUI({
      infoBox("Class with the hightest amount and amount in total of that class", "input$ function needed?")
    })
  
    output$rawdata = renderTable({
      mydf
    })
  
  
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>Could someone please show me how to do this?</p>
  
  <p>Thanks a lot. Appreciate your help.</p>