-4

How would I add some heatmaps plates to a leaflet map?

Say I have some spatial econometrics model and I want to plot prediction to a leaflet map like in the picure attached[![enter image description here][1]][1]

For now I have a simple code in R that goes like this:

m <- leaflet() %>% addProviderTiles("Esri.OceanBasemap") %>% addCircles(lat=df$latitude,lng=df$longitude, radius = 100, color = "green", opacity = 0.45, weight = 7) %>% addCircles(lat=df2$latitude,lng=df2$longitude, radius = 100, color = "#FC4E07", opacity = 0.45, weight = 7)

Petr
  • 1,606
  • 2
  • 14
  • 39
Thomas Kyle
  • 101
  • 1
  • 8
  • [See here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) on making an R question that folks can help with. That includes a sample of data, all necessary code, and a clear explanation of what you're trying to do and what hasn't worked. Otherwise, "how do I do this thing in general?" is too broad – camille Oct 11 '19 at 21:53

1 Answers1

0

Short answer: you can do it using the addHeatmap() function. See this or this tutorial.

Another option is to perform your calculations and then plot the resulting raster file. See the documentation

Orlando Sabogal
  • 1,470
  • 7
  • 20
  • 3
    You might want to revisit [answer]. The question is too broad to give a specific answer to (no code, no data, nothing to debug), and answers that are just links are prone to breaking over time – camille Oct 11 '19 at 21:56