I am trying to set slider in Shiny. Below you can see my code :
column(2,
h4("Baseline-t0"),
sliderInput("simulationSlider1", "Base Year",
min = 2022, max = 2023, step = 1, value = 2022, width = "100%", round = 0),
),
This code produce slider as is shown in the figure below :
Instead of integer numbers, on this slider I can see figure such as 2,022 and 2,023.Can anybody help me how I can set slider to show me integer number such as 2022 and 2023 ?
>Solution :
You can change the sep in the sliderInput, which is sep = "," as default. A fully reproducible example is below:
ui <- fluidPage(
sliderInput("simulationSlider1", "Base Year",
min = 2022, max = 2023, step = 1,
value = 2022, width = "100%",
round = 0, sep = ""),
plotOutput("distPlot")
)
server <- function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$simulationSlider1))
})
}
shinyApp(ui, server)

