concord_geos | R Documentation |
Concord any geography to any other (well, most). It uses meshblocks to weight (either by population or dwellings) and apportion values between geographies. This does not return exactly the same values as official correspondence tables provided by the ABS, in fact it systematically overestimates very low percentages and underestimates very high percentages. The degree of the discrepancy depends on the geographies being concorded, however I think it's good enough for most use cases.
concord_geos(.data, ..., from_geo, to_geo, concord_wt, value, func = "sum")
.data |
( |
... |
columns to group by (e.g. date) |
from_geo |
(unquoted character) the 'from' geography, present in both
|
to_geo |
(unquoted character) the 'to' geography, present in both
|
concord_wt |
(unquoted |
value |
(unquoted character) the column in |
func |
(quoted character; default = |
Make sure your .data
's geo column names match with those available in
get_geos
. There is no error checking for valid geo names
against what's available, yet.
a tibble with columns for ...
, to_geo
and value
## Not run:
# Build your own concordance, for example between SA4 and LGA:
sa4 <- absmapsdata::sa42016 %>%
sf::st_set_geometry(NULL) %>% # Remove the geometry column
select(starts_with("sa4")) %>% # Just keep the identifiers
mutate(pct = 1) %>% # i.e. 100% of a SA4
sak::normalise_geo_names(remove_year = FALSE) # deals with column classes
sa4_lga_concord <- sa4 %>%
concord_geos(sa4_name_2016, sa4_code_2016, # add the identifiers so they
# are returned as columns
from_geo = sa4_code_2016,
to_geo = lga_name_2020,
value = pct
) # i.e. the 100% from above
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.