Interactive Dashboards with Shiny
Some hints on using reactives
This lesson is called Some hints on using reactives, part of the Interactive Dashboards with Shiny course. This lesson is called Some hints on using reactives, part of the Interactive Dashboards with Shiny course.
Transcript
Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.
Your Turn
The reactives/03_assignment/app.R
files contains a couple of mistakes: One is storing the reactive, and the other mistake is calling the reactive. Your job is to fix the code in the apps. Confirm your app runs after you've fixed it.
Have any questions? Put them below and we will help you out!
Course Content
26 Lessons
You need to be signed-in to comment on this post. Login.
Yuri Zharikov • September 18, 2024
I am looking for combining two inputs into one output, e.g. in this example year as a slider and country as a drop down menu. Will this be later in the course or could you please give a hint (or refer to a source). Thank you.
Luis Francisco Gomez Lopez • December 28, 2024
Ted Laderas • September 19, 2024
Hi Yuri,
You can combine multiple inputs in a reactive. Here I'm using two filter statements with two different inputs:
output$biopics_filtered <- reactive({ req(input$year_slider) req(input$country) biopics |> dplyr::filter(year_release < input$year_slider) |> dplyr::filter(country == input$country) })
You can use as many inputs in a reactive as you like. Hope that answers your question.