LoslegenKostenlos loslegen

Add input (UI)

This app will allow users to enter a baby name and visualize the popularity of that name over time.

The first step is to add a text input to the UI that will allow a user to enter their (or any other) name. Try using the optional default argument this time around.

The shiny package is pre-loaded for you.

Diese Übung ist Teil des Kurses

Building Web Applications with Shiny in R

Kurs anzeigen

Anleitung zur Übung

  • Add a text input to the UI, with the inputId, 'name'. Pass it a label (e.g. 'Enter your Name'), and an appropriate default value (e.g. 'David').

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

ui <- fluidPage(
  # CODE BELOW: Add a text input "name"
  
)

server <- function(input, output, session) {

}

shinyApp(ui = ui, server = server)
Code bearbeiten und ausführen