Alteração interativa / reativa de valores mínimo / máximo de sliderInput
encontreialguma informação sobre como mudar ovalue
de umsliderInput
com uma expressão reativa dentro dosiderbarPanel
. Mas em vez dovalue
Eu gostaria de mudarmin
emax
do controle deslizante com umnumericInput
. Emisto roteiro paraserver.R
diz que apenaslabel
evalue
pode ser alterado para sliders. Existe alguma outra possibilidade de alterar os valores mín / máx desliderInput
com uma expressão reativa?
Aqui está um exemplo:
ui.R:
shinyUI(pageWithSidebar(
#Sidebar with controls to select the variable to plot
sidebarPanel(
#Numeric Inputs
numericInput("min_val", "Enter Minimum Value", 1993),
numericInput("max_val", "Enter Maximum Value", 2013),
#Slider
sliderInput("inSlider", "Slider",
min=1993, max=2013, value=2000),
# Now I would like to change min and max from sliderInput by changing the numericInput.
mainPanel()
))
server.R:
library(shiny)
shinyServer(function(input, output, session) {
reactive({
x<-input$min_val
y<-input$max_val
updateSliderInput(session, "inSlider", min=x, max=y, value=x)
})