Created
July 25, 2014 17:39
-
-
Save ijlyttle/97ea3b97195d330ed362 to your computer and use it in GitHub Desktop.
idea to keep status on if data are ready in shiny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| shinyApp( | |
| ui = wellPanel( | |
| actionButton( | |
| "file", | |
| label = "file upload" | |
| ), | |
| actionButton( | |
| "update", | |
| label = "update" | |
| ) | |
| ), | |
| server = function(input, output, session){ | |
| observe(print(paste0("file : ", input$file[[1]]))) | |
| observe(print(paste0("update : ", input$update[[1]]))) | |
| observe(print(paste0("file_at_last_update : ", rct_file_at_last_update()))) | |
| observe(print(paste0("is_ready : ", rct_is_ready()))) | |
| rct_file_at_last_update <- reactive({ | |
| input$update | |
| isolate(input$file) | |
| }) | |
| rct_is_ready <- reactive({ | |
| is_ready <- | |
| input$file > 0 & | |
| input$file == rct_file_at_last_update() | |
| is_ready | |
| }) | |
| } | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment