mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
Deploying to gh-pages from @ agdamsbo/FreesearchR@54dd332cd8 🚀
This commit is contained in:
parent
4cf4bd0499
commit
6d545337de
328 changed files with 12930 additions and 1662 deletions
92
reference/vectorSelectInput.md
Normal file
92
reference/vectorSelectInput.md
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
# A selectizeInput customized for named vectors
|
||||
|
||||
A selectizeInput customized for named vectors
|
||||
|
||||
## Usage
|
||||
|
||||
``` r
|
||||
vectorSelectInput(
|
||||
inputId,
|
||||
label,
|
||||
choices,
|
||||
selected = "",
|
||||
...,
|
||||
placeholder = "",
|
||||
onInitialize
|
||||
)
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- inputId:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
|
||||
- label:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
|
||||
- choices:
|
||||
|
||||
A named `vector` from which fields should be populated
|
||||
|
||||
- selected:
|
||||
|
||||
default selection
|
||||
|
||||
- ...:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
|
||||
- placeholder:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
options
|
||||
|
||||
- onInitialize:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
options
|
||||
|
||||
## Value
|
||||
|
||||
a [`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
dropdown element
|
||||
|
||||
## Examples
|
||||
|
||||
``` r
|
||||
if (shiny::interactive()) {
|
||||
shinyApp(
|
||||
ui = fluidPage(
|
||||
shiny::uiOutput("select"),
|
||||
tableOutput("data")
|
||||
),
|
||||
server = function(input, output) {
|
||||
output$select <- shiny::renderUI({
|
||||
vectorSelectInput(
|
||||
inputId = "variable", label = "Variable:",
|
||||
data = c(
|
||||
"Cylinders" = "cyl",
|
||||
"Transmission" = "am",
|
||||
"Gears" = "gear"
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
output$data <- renderTable(
|
||||
{
|
||||
mtcars[, c("mpg", input$variable), drop = FALSE]
|
||||
},
|
||||
rownames = TRUE
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
#> Error: 'interactive' is not an exported object from 'namespace:shiny'
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue