This R package makes it easy to integrate and control the open-source JavaScript Leaflet software in R.
Questions tagged [r-leaflet]
499 questions
0
votes
0 answers
how to increase the resolution of leaflet maps in R Shiny
I am struggling how to save leaflet maps in a Shiny app in a high resolution.
In the following code a leaflet map is made, and the map can be downloaded by pressing the 'download'…

WJH
- 539
- 5
- 14
0
votes
1 answer
plot a map using lat and lng coordinates in R
My data set has 4 columns which are station_name, station_lat, station_lng and count.This is the example of my data set.
stations <- data.frame(station = c("StreeterDr", "MichiganAve", "WellsSt"), lat = c(41.89228, 41.90096, 41.91213), lng =…

KalsaraL
- 39
- 7
0
votes
0 answers
How can I split points in a map
I use RStudio with leaflet package.
At a fine zoom level in a map, Is there a solution to split 2 points that are located at the same address?

Camel
- 11
- 5
0
votes
1 answer
Leaflet with Shiny - how to ensure maximum zoom in option for the user
For one of the map use case , need to provide maximum zoom in option for the user in shiny app. Have tried to explore some of the options as per below code. Wanted to understand if this is the maximum limit we can have in shiny app using leaflet or…

string
- 787
- 10
- 39
0
votes
1 answer
Plotting points on map returns "object of type 'closure' is not subsettable"
I am new to Shiny. I have the following test data I want to plot:
name lat long
1 AN-02M25 51.95509 -0.960327
2 AN-03M02 52.01291 -0.925606
3 AN-04M04 52.13251 -0.957313
4 AN-05268A 52.10275 -0.812983
5 AN-05M02…

Zizzipupp
- 1,301
- 1
- 11
- 27
0
votes
0 answers
How to add cluster marker icons to the Layers Control in leaflet R
Using the quakes data as an example, I want to assign a random colour to each station in the dataset, use marker clustering, and have icons with the colour in the layer control.
I have managed to do the first part (see code below), but now I want to…

Esteban
- 13
- 3
0
votes
0 answers
Solid color based on 'Zone'
There are 5 main Division (North, South, East, West & Central) and within these divisions, there are zones.
I would like to color the zone based on division, Not sure where the code went wrong?
Thank you!!
enter image description here

techy25
- 1
0
votes
0 answers
Add Legend to Leaflet plot in R & Match Colors
I'm new to the leaflet package and have never added a legend. I'm mapping a couple data sets of real estate sales and want a corresponding legend based on the colors I've indicated in each fillColor argument on the map. I figured out how to add the…

EastBeast
- 89
- 7
0
votes
1 answer
Plotting World chloropeth map with leaflet
I am trying to plot a world map chloropeth but the labels are not showing the correct correctly. I am not sure what the issue might be. See below reproducible code. Once I place the cursor over the US, it shows another label.
## Source of shape…

rabeshi1010
- 145
- 1
- 1
- 8
0
votes
0 answers
How to change color of leaflet map around the polygon shape in r?
I am using a shape file in leaflet plot & would like to have white color space external to the outer boundary of polygon shape instead of default greyish color background like color but unable to do so.
tried with: leaflet(options =…

ViSa
- 1,563
- 8
- 30
0
votes
0 answers
Move map when switching baseGroups layer
I am developing a Leaflet map where I specified three vector layers with addPolygons() and I allow the map user to switch between them using:
addLayersControl(
baseGroups = c("layer_a", "layer_b", "layer_c"))
The three layers have different…

Jackk
- 155
- 5
0
votes
1 answer
Filter out areas from json file
I am new to R Shiny and I'm trying to make a feature on my app where I can choose a dropdown menu of the neighborhoods within a city. With the default selection being the entire city itself SURREY. It is expected that when I select a neighborhood…

myts999
- 45
- 9
0
votes
1 answer
Problem with using barplot and scatter plot in leaflet
I am trying to have both a scatter plot and a barplot in leaflet. The datetable, the leaflet and the scatter plot work fine. The problem is
the barplot does not work when in leaflet we select some points in map as shown in the following figure. Why…

Masoud
- 535
- 3
- 19
0
votes
1 answer
Interactive Map and Lat Lon Input Interface in Rshiny
Here's what I tried
server <- function(input, output) {
observe({
output$mymap <- renderLeaflet({
leaflet() %>%
addTiles() %>%
fitBounds(-124.7666, 49.4000, -67.0583, 25.0666)%>%
setView(-95.91245, 37.2333, zoom =…

Prasad Thota
- 111
- 2
0
votes
1 answer
Highlight marker from user input in leaflet - R Shiny
I'm trying to highlight points in my map based on the user input slider. If the point falls within a certain date range, change the color, and if it doesn't, default it to black.
#server
shinyServer(function(input, output,session) {
…

JNN
- 91
- 9