This is related to my question R using Heatmaps in Leaflet
I have managed to create my heat map but I don't seem to have any gradient of colours. So for example I have a big heat of red with a small border of green across my 20 thousand points but there doesn't seem to be any colour variation.
When I zoom in the clusters break up into smaller clusters which is fantastic but there are not any variations of colours between extremely high areas and very small areas of clustering All the points remain red. Am I missing an option?
Below is a reproducible example
library(leaflet)
library(leaflet.extras)
library(dplyr)
library(readr)
library(htmltools)
library(htmlwidgets)
# Heat Map
heatPlugin <- htmlDependency("Leaflet.heat", "99.99.99",
src = c(href = "http://leaflet.github.io/Leaflet.heat/dist/"),
script = "leaflet-heat.js"
)
registerPlugin <- function(map, plugin) {
map$dependencies <- c(map$dependencies, list(plugin))
map
}
# Build our colour Scheme for what i would like to use
colfunc <- colorRampPalette(c("lightblue","yellow","Red"))
leaflet(quakes) %>% addProviderTiles(providers$CartoDB.DarkMatter) %>%
setView( 178, -20, 5 ) %>%
addHeatmap(lng = ~long, lat = ~lat, intensity = ~mag,
blur = 20, max = 0.05, radius = 15)
UPDATE:
Just to provide a bit of clarity as to what im seeing. The answer to this question on shiny contains the heat map but shows the red with the lack of gradient that im trying to change: Creating Leaflet heatmaps in r and shiny using rCharts