Skip to main content

All Questions

Tagged with
20 votes
2 answers
29k views

leaflet with R: add text labels

This code is taken from this page: library(leaflet) leaflet(data = quakes[1:20,]) %>% addTiles() %>% addMarkers(~long, ~lat, popup = ~as.character(mag)) Instead of markers, is there any way ...
luciano's user avatar
  • 13.7k
6 votes
2 answers
14k views

Draw a map of a specific country with leaflet

I would like to use the package leaflet with R to draw a map of a specific countries such as Italy, Spain, etc. I checked the basic examples with the function setView() and I tried to give a vector ...
Omlere's user avatar
  • 263
5 votes
2 answers
1k views

R: Connecting Dots on a Map

I am working with the R programming language. Using the "leaflet" library, I made the following map for these 5 cities: library(dplyr) library(leaflet) map_data <- data.frame("Lat&...
stats_noob's user avatar
  • 5,689
5 votes
1 answer
5k views

time slider with leaflet/ R

I am currently working in R and I am using leaflet package to vizualize geospatial data, I would like to make an analysis over the time and display my map given a time slider In R there is the ...
Tess's user avatar
  • 129
5 votes
2 answers
6k views

How to plot country-based choropleths using leaflet R

World boundaries geo.json downloaded from here.https://github.com/johan/world.geo.json I am trying to highlight 3 countries(in a world map view) and paint them in gradient color according to numbers ...
Daisywang's user avatar
  • 297
4 votes
2 answers
4k views

Converting data.frame to SpatialPolygonsDataFrame

Here is the data for reproducible purposes: structure(list(countyfp10 = c(1, 1, 1, 1, 3, 3, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7), id = c(7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7425, 7426, 7427, ...
user avatar
4 votes
1 answer
958 views

How to rotate symbols (representing spatial point data) based on feature with tmap and sf?

I want to represent 2 ships on a map in an interactive way (leaflet based method) with some of their metadata as well. Naturally, metadata of a ship usually contains the heading of the vessel and the ...
Alex Karvouniaris's user avatar
4 votes
1 answer
824 views

Customizing Leaflet Map Icons in R

I started to learn how to use the search features in leaflet maps - below is a leaflet map which allows you to search for a city (i.e. single search term): library(leaflet) library(leaflet.extras) ...
stats_noob's user avatar
  • 5,689
3 votes
2 answers
1k views

how to plot multiple isochrone on leaflet map in R

i can plot one isochrone in R at a time using Rmapzen package with this code, each isochrone is generated as a sp object, is there any way to create multiple isochrone on the same map like the ...
santoku's user avatar
  • 3,417
2 votes
1 answer
4k views

Animated marker moving and/or path trajectory with Leaflet and R

I am very excited the spatial abilities of Leaflet combined with R but I badly need the possibility to move around markers and/or draw paths over maps. As far as I see the Leaflet R package lacks this ...
Hendrik's user avatar
  • 1,168
2 votes
0 answers
176 views

How can I use Leaflet (in R) to smoothly pan/zoom from one point to another point?

I am using flyTo() in leaflet (R), but I want to avoid how it zooms all the way out to world view before zooming in to the specified lat/lon. Is there a way to set the start point of the flyTo to ...
Julia Wagenfehr's user avatar
2 votes
0 answers
864 views

leaflet legend for Custom Awesome Marker in R?

I need to add some custom marker legends to my leaflet map. So far, the closest solution I found is this. According to the solution in the link, I need to use the addControl() function. First I ...
user3498115's user avatar
1 vote
1 answer
373 views

Simulating Geographical Points Around the Eiffel Tower

The coordinates of the Eiffel Tower are (Longitude: 48.8584° N, Latitude: 2.2945° E). I am interested in randomly generating 100 points that are located within a 12 KM radius of the Eiffel Tower. In ...
stats_noob's user avatar
  • 5,689
1 vote
2 answers
664 views

How to make dynamic labels from a spatial polygons dataframe for Polygons on a Leaflet map in R

With this script, I am displaying a map with three isochrones. I would like the map to have labels containing the max time represented by each isochrone/polygon. How should I reference the spatial ...
Claudio Paladini's user avatar
1 vote
1 answer
349 views

R: Joining Maps Together

I am working with the R programming language. Using the "leaflet" library, I made the following 3 maps: #load libraries library(dplyr) library(leaflet) library(geosphere) library(leafsync) ...
stats_noob's user avatar
  • 5,689

15 30 50 per page