frank
frank

Reputation: 3608

r leaflet popup not showing anything

I am ploting data via leaflet in R using

leaflet(data=a) %>%
addTiles() %>%
addMarkers(a$long, a$lat, popup=a[,4])

which returns:

enter image description here

but when I have popup=rownames(a), it works:

enter image description here

Any ideas why? I have the same issue with label (works with rownames, not column values)

Upvotes: 1

Views: 881

Answers (1)

frank
frank

Reputation: 3608

it appears it needs to be type character:

popup = as.character(a[,4]) works

Upvotes: 2

Related Questions