View source: R/layer_markers.R
layer_markers | R Documentation |
If get is TRUE
, groupname_col, group_meta, crs, and fn is all passed on to
make_markers.
layer_markers( data, mapping = NULL, geom = "sf", make = FALSE, groupname_col = NULL, group_meta = NULL, crs = NULL, number = FALSE, num_by_group = FALSE, num_style = NULL, num_start = 1, suffix = NULL, sort = "dist_xmin_ymax", desc = FALSE, fn = NULL, ... ) layer_numbers( data, mapping = NULL, geom = "label", make = FALSE, groupname_col = NULL, style = "roundrect", size = 5, sort = "dist_xmin_ymax", num_by_group = FALSE, num_style = NULL, num_start = 1, suffix = NULL, desc = FALSE, fn = NULL, crs = NULL, label.size = 0, label.padding = ggplot2::unit(size/10, "lines"), label.r = label.padding * 1.5, hjust = 0.5, vjust = 0.5, ... )
data |
Data with markers, passed to data parameter of
|
mapping |
Set of aesthetic mappings created by |
geom |
The geometric object to use display the data |
make |
If |
groupname_col |
Group column name, used to join group metadata if
group_meta is a non-spatial data frame; Default: |
group_meta |
Group metadata as a data frame or sf object that intersect
with markers; Default: |
crs |
Coordinate reference system for markers, Default: |
number |
If |
num_by_group |
If |
num_style |
Style of enumeration, either "arabic", "alph", "Alph", "roman", "Roman" |
num_start |
Starting number; defaults to 1. |
suffix |
Character to appended to "number" column. (e.g. "." for "1." or ":" for "1:"). Can also be a character vector with the same length as the number column. |
sort |
Sort column name, Default: "dist_xmin_ymax". |
desc |
If |
fn |
Function to apply to data before results; gives warning if data is
grouped; Default: |
... |
Additional parameters passed to |
style |
Style of number markers to map; defaults to "roundrect". |
size |
Marker size, Default: 5 |
label.size |
Size of label border, in mm. |
label.padding |
Amount of padding around label. Defaults to 0.25 lines. |
label.r |
Radius of rounded corners. Defaults to 0.15 lines. |
hjust, vjust |
Horizontal and vertical justification. |
ggplot2 layers
Other layer:
layer_frame()
,
layer_icon()
,
layer_location_data()
,
layer_mask()
,
layer_neatline()
,
layer_scaled()
nc <- read_sf_path(system.file("shape/nc.shp", package = "sf")) nc <- st_transform_ext(nc, 3857) basemap <- ggplot2::ggplot() + layer_location_data( data = nc, fill = NA ) + ggplot2::theme_void() basemap + layer_markers( data = nc[1:10], mapping = ggplot2::aes(size = AREA), make = TRUE ) large_nc <- get_location_data( data = nc, fn = ~ dplyr::filter(.x, AREA > 0.2) ) basemap + layer_numbers( data = large_nc, mapping = ggplot2::aes(fill = NAME), sort = "dist_xmid_ymid", num_style = "Roman", geom = "label", size = 3 ) + ggplot2::guides(fill = "none")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.