| hotspot_map | R Documentation |
hotspot_map() creates a map from an sf object or the result of an
sfhotspot analysis using reasonable defaults. Maps include an OpenStreetMap
base map by default and are returned as ggplot2::ggplot objects, so they
can be customised with ggplot2 layers, scales and themes.
hotspot_map(object, mapping = NULL, ...)
## S3 method for class 'sf'
hotspot_map(
object,
mapping = NULL,
...,
basemap_type = "osm",
basemap_zoom = NULL,
basemap_attribution = NULL,
caption = NULL,
quiet = TRUE
)
object |
An |
mapping |
An aesthetic mapping created by |
... |
For ordinary |
basemap_type |
A map type passed to the |
basemap_zoom |
The zoom level passed to
|
basemap_attribution |
Attribution for the tile provider, or |
caption |
Additional text to display in the map caption, or |
quiet |
If |
For an ordinary sf object, mapping supplies aesthetic mappings for the
feature layer and ... supplies fixed values and other arguments to
ggplot2::geom_sf(). Hotspot-result objects determine their own aesthetic
mappings, so mapping cannot be supplied for those classes.
A ggplot2::ggplot object.
hotspot_map(memphis_robberies, basemap_type = "none")
hotspot_map(
memphis_robberies,
mapping = ggplot2::aes(colour = offense_type),
basemap_type = "none",
caption = "Memphis robberies"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.