Skip to main content

All Questions

Tagged with
1 vote
1 answer
194 views

Custom legend order in R leaflet

I created a leaflet map and now need to customize the order of the legend. By default leaflet alphabetizes the legend order. In the example below, I need the legend order to be (from top to bottom): ...
0 votes
2 answers
1k views

R Leaflet Limitations? Too much data?

I found a workaround for this that actually worked better for the project I was working on, but I'm still curious. I was creating some maps in R using the leaflet package. The code ran well, but I ...
0 votes
1 answer
61 views

Change leaflet marker fill color by group

In the example below, I have cities located on a leaflet map. I would like the fill color to be yellow for cities in Virginia and green for cities in North Carolina. How can I set the fill colors of ...
0 votes
1 answer
597 views

Multiple layers on TMAP

I have a dataframe looking like this: dataframe Id is the zip code and the columns go from 2015 to 2019. Link to download the database (with the .shp file needed to execute this program) library(...
0 votes
0 answers
50 views

Is there any way to expand polygon objects, just to make them touch each other graphically?

I created these shape objects through K-Means clustering but I want them to have touching borders without doing anything too manual. Any assistance would be great. Working with crime data and it doesn'...
0 votes
1 answer
60 views

Can leaflet layer controls be used to alter popup contents in a Shiny dashboard?

I am building a dashboard in R Shiny that includes a map rendered using R leaflet. There are popups associated with locations on the map and items in the popup are also used as layer controls. i.e., ...
0 votes
1 answer
55 views

Leaflet proxy in r only shows latest added Layer

I want to visualise the development of fatal traffic accidents and accidents with severe injuries on state and community level in a leaflet map. As a solution i use a shiny app with a radio button for ...
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(...
0 votes
0 answers
87 views

Multipage flexdashboard leaflet map issues

I have created a multipage flexdashboard app (.Rmd) in R using shiny runtime. One of the pages is a leaflet map with a large polygon layer. The map initially draws as it should but after I browse ...
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 ...
0 votes
1 answer
267 views

In R, how do I create a spatial grid using Leaflet and SF that is color coded based on some variable

I am working with some state in the United States. I have latitude and longitude data (comprising two different columns) and I have a third column, let's call it L1, containing a value from 1-10. I ...
0 votes
0 answers
92 views

WMS from password protected portal not loading in Leaflet on R - works fine in QGIS

After creating a few WMS, I have tried loading them in R to display them on a map but sadly the leaflet map doesn't show them - only the backdrop does. I had no issue displaying them in QGIS with ...
3 votes
2 answers
2k views

How to change NA values to NULL in a leaflet choropleth map?

I am trying to map a categorical variable that has NA values. I would like the NA values to appear as transparent on the map but they seem to show up as black. library(sf) library(leaflet) library(...
0 votes
1 answer
48 views

R Leaflet layer control fails when using clusterOptions

Layers control in this map work well: library(leaflet) mini_quakes <- head(quakes, 10) mini_quakes$stations <- as.character(mini_quakes$stations) leaflet(mini_quakes) %>% addTiles() %>% ...
1 vote
1 answer
572 views

Leaflet in R - Highlight Polygon on Click

Using the leaflet package in R, I'm looking to highlight / change fillColor of polygon upon click instead of hover. This is in a Shiny app, so I have access to the reactive values, and knowledge of ...

15 30 50 per page