View source: R/number_features.R
number_features | R Documentation |
Used with layer_numbers()
. Supports multiple types of sorting including
sorting:
number_features( data, col = NULL, sort = "dist_xmin_ymax", to = NULL, desc = FALSE, crs = NULL, num_style = "arabic", num_start = 1, suffix = NULL, .id = "number" ) sort_features( data, col = NULL, sort = c("lon", "lat"), to = NULL, desc = FALSE, crs = NULL )
data |
Marker data |
col |
Group column name, Default: |
sort |
Sort column name, Default: "dist_xmin_ymax". |
to |
A |
desc |
If |
crs |
Coordinate reference to use with |
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. |
.id |
Name of the column to use for the feature numbers; defaults to "number". |
by centroid coordinates ("lon", "lat") appended with get_coords()
by one or more bounding box min or max values ("xmin", "ymin", "xmax",
"ymax") appended with get_minmax()
by distance from the corner, side midpoint, or center of a bounding box ("dist_xmin_ymin", "dist_xmax_ymax", "dist_xmin_ymax", "dist_xmax_ymin", "dist_xmin_ymid", "dist_xmax_ymid", "dist_xmid_ymin", "dist_xmid_ymax", "dist_xmid_ymid")
by distance to a point (or sf
, sfc
, or bbox
object) passed to the to
parameter
For example, in the eastern United States, you can sort and number features from the top-left corner of the map to the bottom right by setting sort to "dist_xmin_ymax" (default).
number_features also supports a range of different numbering styles designed to match the standard enumeration options available in LaTeX.
A sf
object with a number column ordered by sort values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.