I am trying to have it so that when a user selects a specimen range and species, the table will only show that range.
The code below creates the table and the inputs, but there appears to be no communication between the two. What am I missing?
Load Libraries
library(shiny)
library(tidyverse)
library(tidytext)
library(glue)
library(plotly)
Read Data
iris <- read_rds("iris.rds")
iris
ui <- fluidPage(
titlePanel("Flower dimensions by species"),
sidebarLayout(
sidebarPanel(
selectInput(
inputId = "species",
label = "Select species",
choices = c("setosa", "versicolor", "virginica")
),
sliderInput(
inputId = "specimen_selection",
label = "Select specimen range",
min = min(iris$id),
max = max(iris$id),
value = 50
)
),
mainPanel(
dataTableOutput(outputId = "Specimen_details")
)
)
)
server <- function(input, output) {
output$Specimen_details <- renderDataTable(iris)
}
Shiny App
shinyApp(ui = ui, server = server)