Stop - delay - trigger

Building Web Applications with Shiny in R

Ramnath Vaidyanathan

VP of Product Research

Isolating actions (1/3)

An app where the user can select a greeting type and enter their name, and in response get a personalized greeting.

Building Web Applications with Shiny in R

Isolating actions (2/3)

An app where the user can select a greeting type and enter their name, and in response get a personalized greeting.

Building Web Applications with Shiny in R

Isolating actions (3/3)

server <- function(input, output, session){
  output$greeting <- renderText({
    paste(

isolate(
input$greeting_type
)
, input$name, sep = " ,") }) }
Building Web Applications with Shiny in R

Delaying actions (1/3)

An app where the user can enter their name, and in response get a personalized greeting.

Building Web Applications with Shiny in R

An app where the user can enter their name, and in response get a personalized greeting.

Building Web Applications with Shiny in R

Delaying actions (3/3)

server <- function(input, output, session){
  rv_greeting <- eventReactive(input$show_greeting, {
    paste("Hello", input$name)
  })
  output$greeting <- renderText({
    rv_greeting()
  })
}
Building Web Applications with Shiny in R

Triggering actions (1/2)

An app where the user can enter their name, and click on a button, and in response get a personalized greeting in a modal dialog box

Building Web Applications with Shiny in R

Triggering actions (2/2)

server <- function(input, output, session){
  observeEvent(input$show_greeting, {
    showModal(modalDialog(paste("Hello", input$name)))
  })
}
Building Web Applications with Shiny in R

Let's practice!

Building Web Applications with Shiny in R

Preparing Video For Download...