Stop - delay - trigger

Créer des applications web avec Shiny en 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.

Créer des applications web avec Shiny en 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.

Créer des applications web avec Shiny en R

Isolating actions (3/3)

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

isolate(
input$greeting_type
)
, input$name, sep = " ,") }) }
Créer des applications web avec Shiny en R

Delaying actions (1/3)

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

Créer des applications web avec Shiny en R

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

Créer des applications web avec Shiny en 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()
  })
}
Créer des applications web avec Shiny en 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

Créer des applications web avec Shiny en R

Triggering actions (2/2)

server <- function(input, output, session){
  observeEvent(input$show_greeting, {
    showModal(modalDialog(paste("Hello", input$name)))
  })
}
Créer des applications web avec Shiny en R

Let's practice!

Créer des applications web avec Shiny en R

Preparing Video For Download...