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)
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.– Marcus Nunes
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.
– Tomás Barcellos
It seems that the problem (judging by the error message) is when you call
metaData
.– Tomás Barcellos
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!
– Arlindo