I want to concatenate multiple columns from a csv
and show the data in a popup for its respective point in R, using Leaflet
.
I have set the points from a csv
, so that it is displayed in R, but from what I have read on the internet, the popups have to be set in html
, and I don't know if it can be read from a columns in the csv
.
This is my code:
library(leaflet)
library(dplyr)
m<-leaflet()
m
ct <- read.csv("data.csv", stringsAsFactors=FALSE) # Brings in the file 'ctlist.csv'
m<-leaflet(ct) %>%
addTiles()%>%
setView(lat=14.0818,lng=-87.20681,zoom=6)
m %>% addCircles(~lng, ~lat, popup=ct$type, weight = 3, radius=40,
color="#ffa500", stroke = TRUE, fillOpacity = 0.8)