Map rendering problem using Leaflet and Flexdashboard packages

Asked

Viewed 33 times

0

Expensive,

I’m not able to render a small map in a Dashboard I’m building using Flexdashboard.

I am receiving the following message: Error: Method not applicable for 'Maxtar' applied to a class object "c('double', 'Numeric')"

I could not understand the problem and did not locate information... someone would have some suggestion?


renderLeaflet({
    
leaflet() %>%
  # chamando o mapa base 
  addTiles() 

leaflet() %>% 
  addTiles() %>% 
  # plotando os pontos no mapa 
  addCircleMarkers(data = cursos, lat = ~latitude, 
                   lng = ~longitude, radius = ~3)
})

# criando uma coluna na tabela de dados com 
# os dados que serão mostrados na janela popup
# mapa_cursos <- cursos %>% 
#   mutate(popup_info = paste ("Nome do curso", nome.curso, "<br/>", 
#                              "Realizado em:", ano, "<br/>", "Cidade", 
#                              municipio, "<br/>", "Estado", UF, "<br/>", 
#                              "Modalidade", modalidade, "<br/>", "Duração",
#                              duracao.dias, "<br/>", "Carga Horária", 
#                              carga.horaria)) 


# inserindo a janela popup no código
# leaflet() %>% 
#   addTiles() %>% 
#   addCircleMarkers(data=mapa_cursos, lat = ~latitude, 
#                    lng = ~longitude, radius = ~3, popup = ~popup_info) 

  • 1

    Welcome to Stackoverflow! Unfortunately, this question cannot be reproduced by anyone trying to answer it. Please take a look at this link (mainly in the use of function dput) and see how to ask a reproducible question in R. So, people who wish to help you will be able to do this in the best possible way.

  • 1

    In addition to what Marcus asked, evaluate the need to keep those blocks of code that are commented on in the question. The more accurate the question, the easier it is to identify the problem and help.

  • It seems that the problem (judging by the error message) is when you call metaData.

  • Dear ones, I was able to identify my problem... as I joined parts of 2 different scripts, I did not notice and I ended up inserting in my code two objects with the same name, so that the content of the "second" subscribed the content the "first"... reason why the columns "latitude" and "longitude" of my original date.frame were not found in the second object to be plotted. Anyway, thank you for the attention and guidance. Next time I will forward the question in the correct way. Abs!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.