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
1 answer
Leaflet equivalent of geom_segments xend, yend arguments
I would like to ask is there a way how to set xend and yend from geom_segment arguments in leaflet`s addPolylines function?
insted of explaining I rather provide reproduceble example since it is mut easire to see rather than…

Petr
- 1,606
- 2
- 14
- 39
0
votes
1 answer
Using checkboxGroupInput for interactive Shiny map
I'm trying to filter markers on a map by using the Check Box Group Input.
titlePanel("Toronto Auto Thefts"),
leafletOutput ("map", width = "100%", height = "100%"),
absolutePanel(
checkboxGroupInput("checkGroup", h3("Week…

softsoap
- 13
- 3
0
votes
1 answer
st_geometry' applied to an object of class "character"
I've put together a script that filters a bunch of things. But whenever I run it I get this error: st_geometry' applied to an object of class "character"
What's bizarre is if I run it outside of my shiny app, like this, it works fine:
mapView(nv %>%…
user12061051
0
votes
2 answers
Collapsing four data frame columns into two, interleaved columns
I am using latitude and longitude data to draw lines on a leaflet map (see below). Ideally the lines would be stored in lat and lng columns in a data frame. In the lat column, each starting point lat value would be followed by an ending point lat…

SlowLearner
- 7,907
- 11
- 49
- 80
0
votes
1 answer
leaflet needs projection for displaying raster
I am trying to create a shiny app that displays raster over a world map. The user will interact with the inputs and the app will generate a raster as well as histogram. The code below generates the histogram but not the map and I wanted help in…

89_Simple
- 3,393
- 3
- 39
- 94
0
votes
0 answers
Is there a function in R Studio to create an interactive map using NYC zip codes?
I have a dataset that has NYC Zip codes, and in a different dataset, I have lat and long codes. I am aware that I can use Leaflet to create an interactive but when I try run it on the 167K rows of data, R Studio freezes and struggles to load the…

Carl O'Beirne
- 309
- 1
- 6
- 17
0
votes
0 answers
leaflet + shiny: "argument is of length zero" in addLegend values
I'm developing a shiny app to show a choropleth map, using leaflet and a shapefile to add the polygons. Outside shiny everything works fine, but with shiny I got a problem when using addLegend as follows:
mypal <- reactive({
colorBin(palette…

cassianord
- 11
- 4
0
votes
0 answers
R - Leaflet map isn't loading in RStudio or Rshiny App - Proxy Authentication Problem
This is my code:
map <- mapLeaflet <- leaflet() %>%
addTiles()
And this is the error:
Failed to load resource: the server responded with a status of 407
(Proxy Authentication Required)
This is how the map appears:

Jole
- 1
0
votes
0 answers
R Shiny dashboard with leaflet maps: image query functionality on my second tab doesn't work
I have an R Shiny dashboard with 2 tabs. Each tab displays a raster.
Image query works on the first tab, but not on the second.
On the second tab it shows a small empty space where the queried data should be displayed, but no values.
If I remove the…

Rainfall.NZ
- 197
- 1
- 12
0
votes
1 answer
Polygon background in leaflet
Is there a way (better in R not to download any additional datasets) how to make polygon (or more visible country borders) in leaflet
Using simple code
m = leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addCircles(lat=15,lng=18, radius =…

Thomas Kyle
- 101
- 1
- 8
0
votes
0 answers
Calculating a new lat/long co-ordinate by adding a distance to a starting co-ordinate?
I have an ascii grid of elevation data in 100M cells. I have a lat/long for a starting point and I need to add up these 100m increments and get new lat/long co-ordinate to draw a colored box around.
Im using R and leaflet to draw a map with the…

Lawrence
- 1
- 1
0
votes
2 answers
Setting color palettes with different "parent" levels?
I'm trying to color in a map with the leaflet package using data that looks as such:
+--------+---------+-------+
| region | terrain | sales |
+--------+---------+-------+
| 1 | 1A | 253 |
| 1 | 1B | 280 |
| 1 | 1C …
user9302275
0
votes
1 answer
Link to image in popup (R leaflet)
I used the code mentioned in other topics here:
link <- c("https://lh4.googleusercontent.com/4okYLMcxk2ZjRqWwSwU8WkEcRQA4NRYxYrlZjieGCace9oNl2DYC78-ZsfIUxu2GKh2_SoPOWluXll2Sl5P0uJxCDPFW_uzQqsW_oHOQ9ept44Ex87I0yw_5EhD6nR1aIRiM")
addCircleMarkers(lng…

Maksym Matsala
- 57
- 9
0
votes
1 answer
How to use shiny range slider to filter points on leaflet point map
I'm trying to use shiny and leaflet to filter the points on a point map on/off depending on the value of a numeric variable ('Population')
I load libraries and data
#load libraries
library(shiny)
library(leaflet)
#create fake data
fake_data <-…

RHinks
- 41
- 5
0
votes
1 answer
Create icons from standard barplot (or ggplot2 geom_col) with single bar
I want to create png icons with single bar (from standard barplot or ggplot2 geom_col). Icons will be presented on leaflet map. There is data.frame: lat,lon,val. Parameter "val" is used to set height of bar (only one bar on one icon). Icons must…

Big Z
- 65
- 7