Skip to main content

All Questions

Tagged with
13 votes
3 answers
7k views

Leaflet on R: How to create layers and colors for each factor level in dataframe

(Btw, is there another package that would do what I want?) Here's my dataset: > head(df) id groupID lat lon 511 1 277706 -10.89834 -37.05893 377 2 277706 -10.88870 -37.07695 98 ...
iatowks's user avatar
  • 1,020
13 votes
2 answers
5k views

leaflet labels overlap fix - leaflet::addMarkers

I am looking for a fix for overlapping labels when using R function leaflet::addMarkers. long <- c(147.768, 147.768, 147.768,147.768, 147.768, 147.768) lat <- c(-36.852, -36.852, -36.852,-36....
Erin's user avatar
  • 265
13 votes
1 answer
3k views

Add different legends in different layers on leaflet map in R

library(leaflet) library(htmltools) library(htmlwidgets) library(dplyr) # df1 <- data.frame(points=c("p1", "p2"), lat=c(49.47259, 49.48095), long=c(-103.7054, -103.6126), value=c(50.34, 100.25)) ...
shashank's user avatar
  • 131
12 votes
3 answers
19k views

street address to geolocation lat/long

I am considering rChart/LeafLet to create a shiny app for housing sales in my county. There are several hundred houses for sale at any given time. Want to map street address-to-geolocation (lat/long) ...
Antex's user avatar
  • 1,414
12 votes
1 answer
6k views

Shiny - how to highlight an object on a leaflet map when selecting a record in a datatable?

Is there a way to highlight a marker or polyline on a leaflet map when selecting (clicking on) the corresponding record in a datatable? I looked at these questions/threads: selecting a marker on ...
M_M's user avatar
  • 909
12 votes
2 answers
10k views

How can I plot individual data points in a map using R/ leaflet?

I am trying to show the individual points in a given place, like a map equivalent of dot plot. I tried with leaflet library in R, but I am only able to map the size of the marker to the continuous ...
karthik2k2's user avatar
12 votes
1 answer
5k views

Leaflet cluster marker spacing, or how to have smaller groups when zoomed out

Making a leaflet map with clustered markers. Is there a parameter in markerClusterOptions() that controls the number of groups based on the zoom level? For example, at default zoom my map shows just 3 ...
dkae's user avatar
  • 313
12 votes
1 answer
3k views

Add title to layers control box in Leaflet using R

I am looking to add a title to the layer control box along the lines of "Available layers". My search has lead me to only one relevant result: Exact same question using JS. Unclear how to translate ...
MokeEire's user avatar
  • 678
12 votes
2 answers
2k views

Cache or pre render leaflet map in shiny app

I am trying to map ~8000 polygons using leaflet and run into performance issues. As I am using the map within a shiny app, I was wondering if its possible to somehow cache or pre-render the map. Note ...
David's user avatar
  • 9,846
12 votes
1 answer
5k views

How to add a text on a leaflet map?

Each day I need to draw a path on a map and add a text like 4, 5 or 8 min. indicating how long it takes by car from the starting point to the destination (see the figure below). I thought it would be ...
user avatar
11 votes
3 answers
14k views

Change the default position of zoom control in leaflet map of Shiny app

I am using Shiny app to create leaflet map, but want to change the default position of zoom control from topleft to topright. R leaflet package sets the default position as topleft in the source ...
Bangyou's user avatar
  • 9,736
11 votes
2 answers
9k views

Can't loop with R's leaflet package to produce multiple maps

New here and relatively new to R also, so please forgive apriori and let me know what I'm doing wrong in this post to avoid annoying others in the future: I am trying to create a sequence (Sep-1971 ...
Naibaf's user avatar
  • 437
11 votes
2 answers
10k views

How to use the Google satellite view as tile in leaflet with R

Many questions seem similar to mine, I could not however find a fitting answer for R. So far, I use the awesome R leaflet (and ggmap) package that way: library(ggmap) library(leaflet) coord <-...
Xavier Prudent's user avatar
11 votes
2 answers
14k views

Variable marker size feature in leaflet R

Is there a way to change the marker size in a map based on a certain value? For example, if I were plotting the population of individual cities and the marker was a circle, the circle would be ...
David Sung's user avatar
11 votes
3 answers
6k views

Create a gif from a series of Leaflet maps in R

I am looking for an automated method to convert leaflet R Studio plots into image files. Seems like exporting a leaflet widget to HTML is straightforward (Saving leaflet output as html). However I ...
sunny's user avatar
  • 3,861

15 30 50 per page