adding many polyLines in R leaflet -
is there way add poly lines @ once. doing way below slow...
at moment, i'm doing through loop follows:
leafletproxy("mainmap") %>% addpolylines(lng = currentgeodata[i,c("custlon","sercenterlon")], lat = currentgeodata[i,c("custlat","sercenterlat")], color = "red")
so each time lng
variable vector of length 2 , lat
variable same.
as long you're going through entire column, don't need index i
:
leafletproxy("mainmap") %>% addpolylines(lng = currentgeodata[c("custlon","sercenterlon")], lat = currentgeodata[c("custlat","sercenterlat")], color = "red")
Comments
Post a Comment