I am plotting 10,000 addresses on a map using leaflet and sp packages. I can see the map with the markers, BUT when I start interacting with the map (zooming and dragging) RStudio freezes! Even after restarting the software and computer. Why is this happening?
The computer is an Intel(R) Core i7-4790 CPU @ 3.60GHZ and 24 GB RAM
RStudio Version: 1.2.1335
Here is the script:
installed.packages("leaflet")
library(leaflet)
library(sp)
addresses <- read.csv("R Studio Projects/Addresses.csv")
addresses$Latitude <- as.numeric(addresses$Latitude)
addresses$Longitude <- as.numeric(addresses$Longitude)
addresses.sp <- SpatialPointsDataFrame(addresses[,c(23,24)], addresses[,-c(23,24)])
m <- leaflet() %>%
addTiles() %>%
addMarkers(data = addresses, lng = ~Longitude, lat = ~Latitude, popup = ~Street)
m