MulaiMulai sekarang secara gratis

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!

Latihan ini adalah bagian dari kursus

Case Studies: Building Web Applications with Shiny in R

Lihat Kursus

Petunjuk latihan

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

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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)
Edit dan Jalankan Kode