If object contains a kde column, density is shown only in cells in which
the Gi*/Gi result passes the specified significance and sign conditions.
The pvalue column is used as supplied and is not adjusted by the plotting
methods. Cells that do not satisfy the conditions are transparent. When
sign = "both", cold-spot densities are negated for plotting and a diverging
scale distinguishes cold spots from hot spots. When only one sign is shown,
a medium-to-dark sequential scale avoids making the least-dense significant
cells appear nearly white. If object does not contain a kde column, the
Gi*/Gi value is plotted using a diverging scale centred on zero and
critical_p and sign do not affect the mapped values.
Usage
# S3 method for class 'hspt_g'
autoplot(
object,
critical_p = 0.05,
sign = c("both", "hot", "cold"),
...,
basemap_type = "none",
basemap_zoom = NULL,
basemap_attribution = NULL,
quiet = TRUE
)
# S3 method for class 'hspt_g'
autolayer(object, critical_p = 0.05, sign = c("both", "hot", "cold"), ...)
# S3 method for class 'hspt_g'
hotspot_map(
object,
mapping = NULL,
critical_p = 0.05,
sign = c("both", "hot", "cold"),
...,
basemap_type = "osm",
basemap_zoom = NULL,
basemap_attribution = NULL,
caption = NULL,
quiet = TRUE
)Arguments
- object
An object with class
hspt_g, e.g. as produced byhotspot_gistar().- critical_p
A single numeric value specifying the largest p-value to treat as statistically significant when plotting density.
- sign
Which significant results should show density:
"both"(the default),"hot"for positive Gi*/Gi values, or"cold"for negative values.- ...
Further arguments passed to
ggplot2::geom_sf(), e.g.alpha.- basemap_type
A map type passed to the
typeargument ofggspatial::annotation_map_tile(), or"none"for no base map.autoplot()defaults to"none"andhotspot_map()defaults to"osm". A base map requires an internet connection unless the required tiles are cached. When a base map is used, the hotspot layer is drawn withalpha = 0.75, overriding anyalphavalue supplied in....- basemap_zoom
The zoom level passed to
ggspatial::annotation_map_tile(), orNULLto choose it automatically.- basemap_attribution
Attribution for the tile provider, or
NULLto use the statement known forbasemap_type. A non-empty string is required for a custom or otherwise unknown map type.- quiet
If
TRUE(the default), suppress progress bars and other messages. IfFALSE, show tile-download progress and other messages.- mapping
For
hotspot_map(), this must beNULL. Hotspot-result objects determine their own aesthetic mappings.- caption
For
hotspot_map(), additional text to display in the map caption, orNULLfor no additional text. Base-map attribution and any explanatory caption generated by the plotting method are retained, with explanatory text above this caption and attribution below it.
Value
autoplot() and hotspot_map() return ggplot2::ggplot objects.
autolayer() returns a layer that can be added to a
ggplot2::ggplot object.
