Casi di studio: creare applicazioni web con 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 = ID univocolabel = Testo che descrive l’input... = Altri parametri specifici dell’inputDue passaggi:
Crea un segnaposto per l’output (nell’UI)
ui <- fluidPage(
"Plot goes here:",
plotOutput(outputId = "my_plot")
)
Scrivi il codice R per generare l’output (nel 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(), ecc.)output$<outputId>input$<inputId> per leggere il valore dell’inputCasi di studio: creare applicazioni web con Shiny in R