Casestudies: webapplicaties bouwen met Shiny in R
Dean Attali
Shiny Consultant



ui <- fluidPage(
textInput(inputId = "name", label = "Enter your name",
value = "Dean"),
numericInput(inputId = "sibs", label = "How many siblings?",
value = 4, min = 0)
)
*Input(inputId, label, ...)inputId = Unieke IDlabel = Tekst die de input beschrijft... = Extra, inputspecifieke parametersTwee stappen:
Maak een placeholder voor de output (in de UI)
ui <- fluidPage(
"Plot komt hier:",
plotOutput(outputId = "my_plot")
)
Schrijf R-code die de output genereert (in de server)
server <- function(input, output) {
# Code for building outputs
}
inputoutputui <- fluidPage( numericInput("num", "Number of rows", value = 10, min = 0), tableOutput("my_table") )server <- function(input, output) { output$my_table <- renderTable({ head(iris, n = input$num) }) }
renderPlot(), renderText(), etc.)output$<outputId>input$<inputId> om de inputwaarde te lezenCasestudies: webapplicaties bouwen met Shiny in R