Hey everyone, Im trying to create a reactive slider for a map in my shiny web app but am running into trouble. Firstly, I want the slider to range from the year 1942 to 2021; however, every time I then run the app the slider has the years displayed as such "1,942" and "2,021" instead of "1942" and "2021." I was wondering if anyone knew how I could get R to stop adding the comma and just leave it as is? The slider does not work and has no change on my corresponding map, but I'm assuming that is due to the disparity in "1,942" and the data saying "1942"
data <- read.csv("data.csv")
ui <- fluidPage(
titlePanel(title=h1("History of Teams in the NHL", align="center")),
sidebarPanel( p("Adjust slider to show NHL teams"),
sliderInput("range", "Year", 1942, 2021, value = c(1942,2021), step = 1
)),
mainPanel(leafletOutput("mymap")))
server <- function(input, output, session) {
hockey <- reactive({
data[data$Year >= input$range[1] & data$Year <= input$range[2],]
})
output$mymap <- renderLeaflet({
leaflet(data) %>%
addTiles() %>%
addMarkers(data = data, ~Long, ~Lat)
})
}
shinyApp(ui, server)