A registered map short-circuits the atom-layer derivation in
geoscale_map() (and thereby recast_geoscale()) for one pair of
resolutions – for cases where the exact correspondence is known
(hand-audited crosswalks, official concordance tables).
Usage
register_geoscale_map(from, to, map, gs = NULL)
get_geoscale_map(from, to, gs = NULL)
list_geoscale_maps()Arguments
- from, to
The pair the map applies to: geoframe names (with
gsnaming the object), Geoscale names, orGeoscaleobjects (their names are used).- map
A
data.frameshaped like ageoscale_map()result: the two label columns named afterfromandto, plusn_from,n_overlap,wandw_from.NULLremoves a previously registered map.- gs
Optional
Geoscale(or its name) scoping a within-object map, so"state" -> "zone"maps of two different objects do not collide. Cross-object maps need no scope.
Value
Invisibly, the registry key. get_geoscale_map() returns the
registered map (or NULL); list_geoscale_maps() a data.frame of
registry keys.
Examples
gs <- geoscale_example()
fake <- data.frame(state = "N1", zone = "ZC", n_from = 1L,
n_overlap = 1L, w = 1, w_from = 1)
register_geoscale_map("state", "zone", fake, gs = gs)
list_geoscale_maps()
#> key
#> 1 example:state->zone
get_geoscale_map("state", "zone", gs = gs)
#> state zone n_from n_overlap w w_from
#> 1 N1 ZC 1 1 1 1
register_geoscale_map("state", "zone", NULL, gs = gs) # remove
clear_geoscale_maps()
