geom_geoscatter | R Documentation |
Each row of data is drawn as a single point inside the geographic area. This has similar strengths to a standard scatter plot, but has the potential to be misleading by implying that there is significance to the exact placement of the points.
geom_geoscatter(
mapping = ggplot2::aes(),
data = NULL,
stat = "geoscatter",
position = "identity",
...,
feature_type = NA,
sample_type = "random",
inset = NA,
map_base = "clip",
map_inset = "auto",
na.rm = TRUE,
show.legend = "point",
inherit.aes = TRUE
)
stat_geoscatter(
mapping = NULL,
data = NULL,
geom = "sf_inset",
position = "identity",
...,
feature_type = NA,
sample_type = "random",
show.legend = NA,
inherit.aes = TRUE
)
mapping, data, stat, geom, position, na.rm, show.legend, inherit.aes, ... |
See |
feature_type |
Type of map feature. See |
sample_type |
sampling type (see the |
inset |
Inset configuration; see |
map_base |
Controls the layer with the base map. Possible values are
|
map_inset |
Controls the layer with the inset map. Possible values are
|
A ggplot layer.
The location
aesthetic is required.
geom_geoscatter()
understands the same aesthetics as ggplot2::geom_point()
.
longitude
latitude
library(ggplot2)
cartographer::nc_type_example_2 |>
ggplot(aes(location = county)) +
geom_boundaries(feature_type = "sf.nc") +
geom_geoscatter(aes(colour = type), size = 0.5) +
coord_automap(feature_type = "sf.nc")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.