Retrieves multiple input values from a shiny input object based on
the names provided in x.
Arguments
- input
A shiny
inputobject, i.e., theinputargument to the shiny server.- x
A character vector of input names, or a data.frame whose column names are converted to input names via
get_input_ids().- ...
Passed onto methods.
Examples
if (FALSE) { # interactive()
library(shiny)
df <- data.frame(
name = c("Alice", "Bob"),
age = c(25, 30),
completed = c(TRUE, FALSE)
)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
filterInput(df)
),
mainPanel(
verbatimTextOutput("output_all"),
verbatimTextOutput("output_subset")
)
)
)
server <- function(input, output, session) {
output$output <- renderPrint({
get_input_values(input, df)
})
output$output_subset <- renderPrint({
get_input_values(input, c("name", "completed"))
})
}
shinyApp(ui, server)
}