LoslegenKostenlos loslegen

Simple text

Every Shiny app has a UI (User Interface) portion and a server portion. The UI is where the visual elements are placed—it controls the layout and appearance of your app. The server is where the logic of the app is implemented—for example, where calculations are performed and plots are generated.

An empty UI is created using the fluidPage() function. Adding text to a Shiny app is done by adding text inside fluidPage() as an argument. In fact, the entire UI is built by supplying the fluidPage() function with as many arguments as you want.

Diese Übung ist Teil des Kurses

Case Studies: Building Web Applications with Shiny in R

Kurs anzeigen

Anleitung zur Übung

Create a Shiny app that displays the text "Shiny is fun" by following these specific instructions:

  • Load the shiny package.
  • Create the UI for the Shiny app using the fluidPage() function.
  • Add the text "Shiny is fun" to the UI.

Interaktive Übung

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

# Load the shiny package
___

# Define UI for the application
ui <- ___(
  # Add the text "Shiny is fun"
  ___
)

# Define the server logic
server <- function(input, output) {}

# Run the application
shinyApp(ui = ui, server = server)
Code bearbeiten und ausführen