render mapboxer on shiny

Hello everyone, i have a problem to render a filtered mapboxer on shiny. I get the error Problem withmutate()columncolor. e[34mℹe[39m color = pal(pop_est). e[31mxe[39m unused argument (pop_est) and i don't now why :pensive:

Any ideas or suggestions?

The code is the following:

data("World")

ui <- fluidPage(
  
  selectInput("var","escoge un continente",
              choices = list("Asia" = "Asia",
                             "Africa" = "Africa",
                             "Europa" = "Europe",
                             "America" = "North America")       
  ),
  mapboxerOutput("map")
  
)

server <- function(input, output){
  
  dato <- reactive({
    
    World |> 
      filter(continent == input$var)
  
  })
  
  pal <- reactive({
    scales::col_quantile("Greys",  dato()$pop_est)
  })
  
  bbox <- reactive({
    unname(sf::st_bbox(dato() ))
  })
  
  output$map <- renderMapboxer({
    
    dato() %>%
      dplyr::mutate(color = pal(pop_est)) %>%
      as_mapbox_source() %>%
      mapboxer(bounds = bbox(), pitch = 25, zoom = 10) %>%
      add_navigation_control() %>%
      add_fill_layer(
        fill_color = c("get", "color"),
        fill_opacity = 0.5,
        fill_outline_color = "white",
        popup = "Población estimada: {{pop_est}}"
      )
    
  })
  
  
  
}



shinyApp(ui, server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.