Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Case Studies: Building Web Applications with Shiny in R

Cursus bekijken

Oefeninstructies

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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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 bewerken en uitvoeren