concord_geos: All geographies concordance

View source: R/concord_geos.R

concord_geosR Documentation

All geographies concordance

Description

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.

Usage

concord_geos(.data, ..., from_geo, to_geo, concord_wt, value, func = "sum")

Arguments

.data

(tibble) with suitably named geo columns

...

columns to group by (e.g. date)

from_geo

(unquoted character) the 'from' geography, present in both .data and returnable by get_geos

to_geo

(unquoted character) the 'to' geography, present in both .data and returnable by get_geos

concord_wt

(unquoted persons or dwellings) how to weight the meshblocks

value

(unquoted character) the column in .data to concord across geographies

func

(quoted character; default = "sum") one of "sum" or "mean", how should the value be concorded? If the quantity is additive, then "sum" makes sense. However if it is a rate or similar then "mean" (which is a weighted mean based on the concord_wt) might be more sensible.

Details

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.

Value

a tibble with columns for ..., to_geo and value

Examples

## 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)

baslat/sak documentation built on April 14, 2025, 4:14 p.m.