Skip to main content
How are we doing? Please help us improve Stack Overflow. Take our short survey

All Questions

Tagged with
5 votes
2 answers
3k views

Leaflet not rendering in dynamically generated R markdown html knitr

I've created a R markdown report where the sections and tabsets are dynamically created. I have an issue where the Leaflet maps are not being generated in the output, but rather a blank white space. ...
Jonathan West's user avatar
4 votes
1 answer
2k views

merging palettes with colorRampPalette and plotting with leaflet

I'm trying to merge two colorRampPalette schemes to use in leaflet and have been following this nice example. That example works fine but I can't seem to get it to work for my work, reproducible ...
user63230's user avatar
  • 4,472
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
4 votes
1 answer
6k views

adding border to CircleMarkers with leaflet and R

I would like to add border to the CircleMarkers. I used the following code. I can't find any function to add black border to the stroke. pal <- colorNumeric(palette = 'RdYlBu', domain = ...
user6041789's user avatar
4 votes
1 answer
2k views

How to assign popup on map polygon that corresponds with the country R leaflet

I am trying to write a script that would allow people to click on a country then a popup would appear and show the country's name and corresponding value. I have successfully created the map and the ...
user avatar
3 votes
3 answers
1k views

Plotting routes that cross the international dateline using leaflet library in R

I am interested in plotting the route from Waterloo to Taiwan using the leaflet library for R. The coordinates for the route was obtained using gcIntermediate function from geosphere. However, the ...
Daxaniie's user avatar
3 votes
1 answer
3k views

How to create an event when pressing on a leaflet popup in R?

I would like to make the tabPanel change in Shiny when I click on a Leaflet polygon. I have a couple of ideas on how to do this, but I can't find the information I need to implement them. I have the ...
Abdalah El-Barrad's user avatar
2 votes
1 answer
7k views

How to add multiple polygons in leaflet map using r loop?

I'm trying to add multiple polygon to leaflet world map, according to a number of lists of country code. And I was trying to use R loop to add the polygon. Here's the code that I manually add polygons ...
Daisywang's user avatar
  • 297
1 vote
1 answer
4k views

Dynamic Color Fill For Polygon Using Leaflet In Shiny Not Working

My goal is to create a map that highlights states based on a dropdown menu. I have produced a map that works as intended for one of the metrics in the data set, but when I try and recreate the map in ...
ILikeWhiskey's user avatar
1 vote
1 answer
566 views

Value assigned to the wrong country using Leaflet and Maps

I'm trying to plot European Countries using Leaflet but the Values that are assigned to the countries are incorrect. The goal is to create a choropleth map of Europe where each country has a specific ...
Joris Bertens's user avatar
1 vote
1 answer
2k views

Leaflet separate lines

I am trying to plot lines using leaflet, however I am encountering some difficulties in separating the segment. I have an object that looks like this > head(trips, n=15) time.start time.end ...
Marco De Virgilis's user avatar
1 vote
2 answers
227 views

How to make small polygons from shapefile and extract coordinates

I have a small shapefile here: https://login.filesanywhere.com/fs/v.aspx?v=8c6d62865c626fb4a2ab called bay.RDS library(tmap) library(leaflet) library(mapview) bay <- readRDS('bay.RDS') mapview(...
Salvador's user avatar
  • 1,467
1 vote
1 answer
994 views

Geomapping Data in Shiny

I have two set of data that I am attempting turn into geomaps using rshiny. I have been able to get the coordinates of my locations, and have been able to get them mapped on R. I am now starting my ...
M.McHugh's user avatar
0 votes
2 answers
2k views

merging palette colors colorRampPalette and plotting with ggplot

I'm trying to replicate using ggplot2, an earlier question i had using leaflet. I'm trying to merge two palettes where one is used if my variable is below a certain threshold and another if above a ...
user63230's user avatar
  • 4,472
0 votes
1 answer
80 views

How to set an anchor and create polygons from shapefile

I am following up on the example here: How to make small polygons from shapefile and extract coordinates I am trying to adapt that example to a different shapefile but I am getting errors. The new ...
Salvador's user avatar
  • 1,467