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 lngvariable 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

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -