AddHeatMap: Add a heat map.

Description Usage Arguments Value See Also Examples

Description

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.

Usage

1
AddHeatMap(map,dataHeatMap,bandwidth=NULL)

Arguments

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

Value

The initial map + the heat map.

See Also

bkde2D, contourLines, Polygons, SpatialPolygons, SpatialPolygonsDataFrame, addPolygons

Examples

 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))

Blitzy29/R.Maps documentation built on May 6, 2019, 7:57 a.m.