Case Studies: створення вебзастосунків із Shiny в 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 = Унікальний IDlabel = Текст-опис для введення... = Додаткові параметри для цього типу введенняДва кроки:
Створіть місце для виводу (в UI)
ui <- fluidPage(
"Plot goes here:",
plotOutput(outputId = "my_plot")
)
Напишіть код R для генерації виводу (в 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(), тощо)output$<outputId>input$<inputId> для доступу до значення входуCase Studies: створення вебзастосунків із Shiny в R