View source: R/cartographer-global.R
| register_map | R Documentation |
This adds a new feature type that can then be used by all the geoms in this
package. If registering from another package, this should occur in the
.onLoad() hook in the package.
register_map(
feature_type,
data,
feature_column,
aliases = NULL,
outline = NULL,
lazy = TRUE
)
feature_type |
Name of the type. If registering from within a package,
the suggested format is |
data |
A simple feature data frame with the map data, or a function
that returns a data frame. When |
feature_column |
Name of the column of |
aliases |
Optional named character vector or list that maps aliases to values that appear in the feature column. This allows abbreviations or alternative names to be supported. |
outline |
Optional sf geometry containing just the outline of the map,
or a function returning such a geometry. When |
lazy |
When |
Registration supports delayed evaluation (lazy loading). This is particularly useful for larger datasets, so that they are not loaded into memory until they are accessed.
No return value; this updates the global feature registry.
vignette("registering_maps")
# register a map of the states of Italy from rnaturalearth using the
# Italian names, and providing an outline of the country
register_map(
"italy",
data = rnaturalearth::ne_states(country = "italy", returnclass = "sf"),
feature_column = "name_it",
outline = rnaturalearth::ne_countries(country = "italy", returnclass = "sf", scale = "large")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.