Here You have the solution for Your question of radioButtons
with the option All:
library(shiny)
library(DT)
value <- c(1,2,3)
variable <- c("A","B","C")
data <- data.frame(value, variable)
ui= fluidPage(
radioButtons("choice","Choose:", choices = c("A","B","C","All"), selected = "All"),
dataTableOutput("tab")
)
server= function(input, output,session) {
data_reactive <- reactive({
if(input$choice =="All"){
data <- data
}
else{
data <- data[data$variable %in% input$choice, ]
}
data
})
output$tab <- DT::renderDataTable({
datatable(data_reactive())})
}
shinyApp(ui, server)
and for the future as @Konrad said, it would be good if You post reproducible example and more clearly define the problem.