1

I have a shiny app that I'm builidng which includes a slider to display the years 1965 to 1980. Currently it only shows every other year but I'd like it to show all the years because its a little bit confusing to users right now as it doesn't appear that every year between 65 and 80 is there.

Here's an image showing what I currently see.

Here is the relevant code:

sliderInput("map.year", "Year",
                       min = 1965, max = 1980,
                       value = 1900, sep = "", round = TRUE, step = 1, width = "100%")

Is there an option to force the slider to display all years? Thanks in advance for the help!

1 Answers1

0

FYI this was answered before here: https://stackoverflow.com/a/50222952/4954719

rng <- 1965:1980
sliderTextInput("map.year", "Year",
                       choices = rng,
                       selected = rng[1],
                       grid = T,
                       width = "100%")

I changed your selected value as it is not in your specified range.

bikeactuary
  • 447
  • 4
  • 18