모든 단어 소스 결합

사례 연구: R의 Shiny로 웹 애플리케이션 만들기

Dean Attali

Shiny Consultant

모든 단어 소스 결합

  • 워드 클라우드를 위한 3가지 데이터 소스

    • 텍스트 객체: artofwar
    • 사용자 텍스트: textAreaInput()
    • 텍스트 파일: fileInput()
  • 다음 단계: 모두 함께 지원

    • 단어 소스 선택용 라디오 버튼

사례 연구: R의 Shiny로 웹 애플리케이션 만들기

라디오 버튼 - 복습

radioButtons(
    "time_of_day", "Choose your favorite time of day",
    choices = c("Morning", "Afternoon", "Evening"),
    selected = "Afternoon"
)

사례 연구: R의 Shiny로 웹 애플리케이션 만들기

라디오 버튼 - 고급

radioButtons(
    "time_of_day", "Choose your favorite time of day",
    choices = c("I'm a morning person!" = "Morning",
                "Love my afternoons"    = "Afternoon",
                "Night owl here!"       = "Evening"),
    selected = "Afternoon"
)

str(input$time_of_day)
chr "Afternoon"
사례 연구: R의 Shiny로 웹 애플리케이션 만들기

조건부 패널

  • 입력 값에 따라 UI 요소 표시/숨기기
conditionalPanel(condition, ...)
  • condition은 R 코드와 유사하나, input$<id> 대신 input.<id> 사용
  • ...에는 임의의 UI 포함 가능
사례 연구: R의 Shiny로 웹 애플리케이션 만들기

조건부 패널

ui <- fluidPage(
  radioButtons("time_of_day",
               "Choose your favorite time of day",
               ...),

  plotOutput("morning_only_plot")
)
ui <- fluidPage(
  radioButtons("time_of_day",
               "Choose your favorite time of day",
               ...),

  conditionalPanel(
    condition = "input.time_of_day == 'Morning'",
    plotOutput("morning_only_plot")
  )
)
사례 연구: R의 Shiny로 웹 애플리케이션 만들기

Ayo berlatih!

사례 연구: R의 Shiny로 웹 애플리케이션 만들기

Preparing Video For Download...