action-button

Link R shiny selectInput item to open file actionButton

跟風遠走 提交于 2021-02-19 06:22:48
问题 Using R shiny, is it possible to link selectInput item to open file action button ? I would like to adapt onclick argument of action button to achieve it. Please find below a reproductible example: Supposing we have "file_1.pdf" and "file_2.pdf" on "www" folder, how can I open the file corresponding to select Input choice ? library(shinydashboard) library(shiny) ui <- dashboardPage( dashboardHeader(title = "Open file app"), dashboardSidebar(), dashboardBody( fluidRow( selectInput(inputId =

How to make actionButton only work when all inputs are given in R shiny?

无人久伴 提交于 2021-02-08 04:19:30
问题 Currently my actionButton is taking in user input through drop down lists, and then when the actionButton is pressed it outputs this to a csv file. However, if the user only inputs 2 out of the 5 drop down lists and presses the actionButton this will still go to the csv file. How can I make it so it only accepts the actionButton if all inputs are given? I am using observeEvent(). 回答1: if you use the packages shinyjs you can deactivate the button when not all inputs are given with something

Adding custom ActionButtons to popups in leaflet map within shiny app

若如初见. 提交于 2021-01-29 10:49:57
问题 I'm trying to build an app in R shiny where users can learn details about points on a map. When users click on a point, a popup shows some initial details and then an ActionButton (or ActionLink). When the user clicks on that ActionButton, ObserveEvent reactive launches a modal dialog displaying more information about that point. I have the maps, action buttons, and modal dialogs in place. However, I can't figure out how to "assign" each ActionButton to its point/popup on the map. Is there a

How to display default plot in www/ before actionButton is clicked R shiny

淺唱寂寞╮ 提交于 2020-12-15 18:55:50
问题 Here is a sample code to generate a plot upon clicking the actionButton. shinyApp( shinyUI(fluidPage( inputPanel( numericInput("n", "n", 10), actionButton("update", "Update") ), plotOutput("plot") )), shinyServer(function(input, output) { values <- reactiveValues() values$data <- c() obs <- observe({ input$update isolate({ values$data <- c(values$data, runif(as.numeric(input$n), -10, 10)) }) }, suspended=TRUE) obs2 <- observe({ if (input$update > 0) obs$resume() }) output$plot <- renderPlot({

R Shiny: Click Button Within Datatable to Display Popup Twice in a row

狂风中的少年 提交于 2020-11-24 20:00:29
问题 Using RStudio 1.0.136 and R Shiny 0.14.2, I am trying to create a data table that has an action button on each row, and when a button is clicked a popup will appear. My code is currently working, except you cannot click the same button twice in a row. I have posted 2 versions of example code below: library(shiny) library(DT) library(shinyBS) shinyApp( ui <- fluidPage( DT::dataTableOutput("data"), uiOutput("modal") ), server <- function(input, output,session) { shinyInput <- function(FUN, len,

R Shiny: Click Button Within Datatable to Display Popup Twice in a row

时间秒杀一切 提交于 2020-11-24 19:58:19
问题 Using RStudio 1.0.136 and R Shiny 0.14.2, I am trying to create a data table that has an action button on each row, and when a button is clicked a popup will appear. My code is currently working, except you cannot click the same button twice in a row. I have posted 2 versions of example code below: library(shiny) library(DT) library(shinyBS) shinyApp( ui <- fluidPage( DT::dataTableOutput("data"), uiOutput("modal") ), server <- function(input, output,session) { shinyInput <- function(FUN, len,

Isolate() is not working when used inside an if statement in a shiny app

…衆ロ難τιáo~ 提交于 2020-04-30 06:26:19
问题 I have the shiny app below in which I have 3 file inputs and 2 actionbuttons. The 1st submit button 'submit' is used to trigger the tree plot and the 2nd 'reset' to reset every file input. When the 1st actionbutton is empty I get a warning message. The tree is displayed only when the all of the files are loaded or 1st and 2nd are loaded or only 1st is loaded. Based on this I have crated an if statement which you can find in line 120. The issue is that while the app works fine it does not