Questions tagged [shiny-reactivity]

A key aspect of Shiny apps is reactivity - the illusion that the application is interactive.

A key aspect of Shiny apps is reactivity - the illusion that the application is interactive. See http://shiny.rstudio.com/articles/reactivity-overview.html

972 questions
95
votes
2 answers

R shiny passing reactive to selectInput choices

In a shiny app (by RStudio), on the server side, I have a reactive that returns a list of variables by parsing the content of a textInput. The list of variables is then used in selectInput and/or updateSelectInput. I can't make it work. Any…
PatrickT
  • 10,037
  • 9
  • 76
  • 111
34
votes
4 answers

How to listen for more than one event expression within a Shiny observeEvent

I want two different events to trigger an observer. It was suggested here that this should work. But it seems that it depends only on the second event. observeEvent({ input$spec_button mainplot.click$click }, { ... } ) Have a look at the…
Kipras Kančys
  • 1,617
  • 1
  • 15
  • 20
17
votes
2 answers

Can I save the old value of a reactive object when it changes?

Note: After coming up with the answer I reworded the question to make if clearer. Sometimes in a shiny app. I want to make use of a value selected by the user for a widget, as well as the previous value selected for that same widget. This could…
John Paul
  • 12,196
  • 6
  • 55
  • 75
11
votes
1 answer

R Shiny: Reactive Error

I'm building my first Shiny app with the intent of creating a mortgage calculator and adjustable amoritization schedule. I am able to get the following code to render with runApp(), but it is not functional (i.e., doesn't output any values, nor…
Ryan S
  • 165
  • 1
  • 2
  • 7
10
votes
1 answer

Stored Input values in shiny widgets?

I am trying to understand the value stored in shiny inputwidgets. I have written below code which outputs a sliderInput and based on the value of sliderInput, another o/p element is generated i.e. If sliderInput value > 30 then it generates …
Rohit Saluja
  • 1,517
  • 2
  • 17
  • 25
9
votes
0 answers

Error while using outputOptions in R shiny

I have a select box in a shiny app which I am trying to use outputOptions so that it will render all the tabs in my report generated using r-markdown. Below is the code for that: observeEvent(input$tab, { if (input$tab == "fruits"){ choices…
SNT
  • 1,283
  • 3
  • 32
  • 78
7
votes
1 answer

R Shiny - How to update a dependent reactive selectInput before updating dependent reactive plot

App Structure I have a Shiny app with the typical sidebar panel + mainpanel structure. Sidebar panel: There are multiple selectInput widgets within the sidebarpanel, where the choices within each selectInput are dependent upon the previous…
trippy
  • 130
  • 5
7
votes
0 answers

Wide datatables causing scrollx to scroll back when applying filters

I am able to render a datatable in my shiny app. However, whenever there is a wide table, the horizontal scroller gets back to it's initial position when you apply filters on the columns in the back. This issue occurs with numeric columns only. I…
AOE_player
  • 536
  • 2
  • 11
7
votes
1 answer

Loading shiny module only when menu items is clicked

Background Within a modular1 Shiny application, I would like to load module only when menu item on shinydashboard is clicked. If the menu item is not accessed I wouldn't like to load the module. Basic application app.R #…
Konrad
  • 17,740
  • 16
  • 106
  • 167
7
votes
1 answer

Shiny modularized inputs inside pop-up modal aren't being written to reactiveValues when dismissed [flexdashboard/shinydashboard]

As a minimally-viable example, I modularized the basic example from here: https://rmarkdown.rstudio.com/flexdashboard/shiny.html#simple_example Code snippet (copy-paste, run as .Rmd in RStudio should do the trick): --- title: "stackoverflow…
Ray
  • 3,137
  • 8
  • 32
  • 59
6
votes
1 answer

In Shiny, what's the difference between req() and an if() statement?

Let's say I have the following UI: ui <- fluidPage( checkboxGroupInput("checkbox", "", choices = colnames(mtcars)), tableOutput("table") ) I want to render a table of mtcars once at least one checkbox option has been selected. For this, I came…
David Jorquera
  • 2,046
  • 12
  • 35
6
votes
1 answer

R shiny: how to change values in a reactiveValues object

I am developing some shiny apps with various inputs. In general, I have a setup where I want the user to push a button to accept the input values, which will then create objects that need to be set up. The a simulation should run when the user…
Sam A.
  • 413
  • 4
  • 13
5
votes
1 answer

Shiny: Add a hover button on select input choice

The problem: I am trying to add 'hover text' to the choices available in the select input/multi input function in shiny. According to a different user, ShinyBS's tooltip function is only designed for selection by id. Thus, I am trying to use…
NewBee
  • 990
  • 1
  • 7
  • 26
5
votes
3 answers

How to Retain the values in the Check Box in R Shiny App?

I am trying to create a Shiny App. In this particular app i have a set of Radio buttons where choosing one will display a set of options below as Check Boxes and Choosing another radio button will choose other set of options. Kindly find the UI and…
David Chris
  • 255
  • 4
  • 16
5
votes
1 answer

Shiny renderPlot using action button

I'm trying to create a Shiny app where the user can select the x and y axes to plot, then click "Add Graph" for the graph to plot - but this code isn't working and I'm unsure why. Do I need to set input$x_iris and input$y_iris as reactives?…
MayaGans
  • 1,815
  • 9
  • 30
1
2 3
64 65