New to R Studio and Shiny. I am trying to build a simple table as shown..
Here is my code, I think the UI is correct for the most part I just don't really know what to put in for the server.
I need to make it so that whatever you put in for the input only renders that number of rows from the mpg data.frame.
library(shiny)
library(ggplot2)
ui <- fluidPage(
# Application title
titlePanel("Homework 3"),
sidebarLayout(
sidebarPanel(
numericInput(inputId = "n",
label = "Number of Observations",
value = 6,
min = 0,
max = 20)
),
mainPanel(
tableOutput(outputId = "table")
)
)
)
# Define server logic required
server <- function(input, output) {
output$table <- renderPrint({
#NEED HELP HERE
#THANKS
})
}
# Run the application
shinyApp(ui = ui, server = server)