2016년 8월 4일 목요일

Rstudio Shiny: Build a dynamic UI that reacts to user input

Dynamic UI

Shiny apps are often more than just a fixed set of controls that affect a fixed set of outputs. Inputs may need to be shown or hidden depending on the state of another input, or input controls may need to be created on-the-fly in response to user input.

Shiny currently has three different approaches you can use to make your interfaces more dynamic. From easiest to most difficult, they are:

The conditionalPanel function, which is used in ui.R and wraps a set of UI elements that need to be dynamically shown/hidden
The renderUI function, which is used in server.R in conjunction with the htmlOutput function in ui.R, lets you generate calls to UI functions and make the results appear in a predetermined place in the UI
Use JavaScript to modify the webpage directly.
Let’s take a closer look at each approach.

http://shiny.rstudio.com/articles/dynamic-ui.html

댓글 1개:

  1. Interactively change the selectInput choices
    http://stackoverflow.com/questions/16173325/interactively-change-the-selectinput-choices

    답글삭제