Description Usage Arguments Value See Also Examples
Add a heat map to a map. The heat map is based on the number of rows per couple longitude-latitude (bandwidthed). If the bandwidth is set to NULL, it will be initialized with the 50th of the longitude and latitude width.
1 | AddHeatMap(map,dataHeatMap,bandwidth=NULL)
|
map |
a map |
dataHeatMap |
a data.table that will be used for the heat map. It must has 2 columns called 'longitude' and 'latitude' |
bandwidth |
numeric vector oflength 2, containing the bandwidth to be used in each coordinate direction |
The initial map + the heat map.
bkde2D, contourLines, Polygons, SpatialPolygons, SpatialPolygonsDataFrame, addPolygons
1 2 3 4 5 6 7 8 9 10 | # # Test data frame
# testDF <- data.table(latitude=c(48.875403,48.904567,48.875403),
# longitude=c(2.317795,2.255450,2.317795))
# # Create a map
# map <- leaflet()
# # Add heat map
# map %>% AddHeatMap(testDF)
# map %>% AddHeatMap(testDF,bandwidth=c(0.2,0.1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.