LoslegenKostenlos loslegen

Formatted text

Shiny has many functions that can transform plain text into formatted text. Simply place text inside the h1() function to create a primary header (e.g. a title), h2() for a secondary header, strong() to make text bold, em() to make text italicized, or any of the other formatting functions.

You can also intermingle plain text and formatted text as much as you'd like—just remember to separate all the elements with commas!

Diese Übung ist Teil des Kurses

Case Studies: Building Web Applications with Shiny in R

Kurs anzeigen

Anleitung zur Übung

Place the following text inside the Shiny app:

  • The word "DataCamp" as a primary header.
  • The words "Shiny use cases course" as a secondary header.
  • The word "Shiny" in italics.
  • The words "is fun" as bold text.

After completing the instructions, your Shiny app should render the following text:

DataCamp

Shiny use cases course

Shiny is fun

Interaktive Übung

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

# Load the shiny package
library(shiny)

# Define UI for the application
ui <- fluidPage(
  # "DataCamp" as a primary header
  ___,
  # "Shiny use cases course" as a secondary header
  ___,
  # "Shiny" in italics
  ___,
  # "is fun" as bold text
  ___
)

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

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