How to build data frames in different tabs instead of doezns of textOutputs?
<p>I'm a beginner on R and Shiny and I would like to adapt a code I've found with Shiny examples, please type <code>runExample("05_sliders")</code> on console to see it.</p>

<p>I would like to get a table as the one on the right of the screen, but with variables I would have chosen and in 2 different tabs, because I'll have dozens of variables to show finally, but I can't manage to do it.</p>

<p>I have created 3 tabs : <code>Selection</code>, <code>Gear</code> and <code>Carb</code>.
I have a <code>checkboxGroupInput</code> in the <code>Selection</code> tab where I chose between 4, 6 or 8 cylinders.
Once I have made my choice, I would like 2 different data frames :
- one in "Gear" tab, where is shown the number of cars which have 3, 4 or 5 gears, and the number for which "vs" = 0 or 1,
- one in the "Carb" tab I would like to have the number of cars of each "carb" value and the number of cars of each "am" value.</p>

<p>But it doesn't work at all and I don't understand why.
If you could give me help please.</p>

<p>This is the code :</p>

<pre><code>Ui.R
library(shiny)

shinyUI(navbarPage("MTCARS",
               tabPanel("Sélection",
  checkboxGroupInput("dynamic", label = "Cars",
             choices = list("4 cylinders" = 4, "6 cylinders" = 6,
                            "8 cylinders" = 8)),
               tabPanel("Gear",
                       mainPanel(
                         tableOutput("Gear")),

               tabPanel("Carb",
                        mainPanel(
                          tableOutput("Carb")
                        ))))))

Server.R
library(shiny)
# Define server logic
function(input, output) {

# Reactive expression to compose a data frame containing all of
# the values
selection_cylinder &lt;- reactive({
filter(mtcars, cyl %in% input$dynamic)
})
selection_cylinder &lt;- reactive({
filter(mtcars, cyl %in% input$dynamic)
})

# Compose tab "Gear" data frame
data.frame(
  Name = c("Gear", 
           "vs"),
  Value = as.character(c(input$dynamic, 
                         input$dynamic), 
  stringsAsFactors=FALSE))

# Compose tab "Carb" data frame    
data.frame(
  Name = c("Carb",
           "am"),
  Value = as.character(c(input$dynamic,
                         input$dynamic),
  stringAsFactor=FALSE))

# Show the values of the "Gear" data frame using an HTML table
output$Gear &lt;- renderTable({
selection_cylinder()
})

# Show the values of the "Carb" data frame using an HTML table
output$Carb &lt;- renderTable({
selection_cylinder()
})
}
</code></pre>

<p>It doesnot function at all, so if you could give me a help please.</p>

<p>I'm a little bit lost.</p>

<p>Thank you very, very much to everybody.</p>