Title: | Maps of Australia |
---|---|
Description: | Granular maps of Australia using ABS boundaries from 2006-2021. |
Authors: | Carlos Yáñez Santibáñez [aut, cre], Craig Alexander [ths], Australian Bureau of Statistics [cph] |
Maintainer: | Carlos Yáñez Santibáñez <[email protected]> |
License: | CC BY-SA 4.0 |
Version: | 0.2.2.0002 |
Built: | 2025-02-05 03:26:47 UTC |
Source: | https://github.com/carlosyanez/aussiemaps |
Helper function to delete data
data_maps_delete(...)
data_maps_delete(...)
... |
fs::dir_info() parameters |
nothing
Helper function to update/download data
data_maps_info(...)
data_maps_info(...)
... |
fs::dir_info() parameters |
nothing
Helper function to find cache folder
find_maps_cache()
find_maps_cache()
nothing
This function's preforms for a left_join() between to datasets, accomdating for small differences in formatting across the key, for example a O'Connor vs. Oconnor (as in the Australian electoral division)
flexible_left_join(df1, df2, by)
flexible_left_join(df1, df2, by)
df1 |
first dataset (of sf data frame) |
df2 |
second dataset |
by |
named vector with join key, as in left_join |
A data frame containing the aggregated data
Convert data, aggregating smaller geographic structures into larger ones. By default it uses area to apportion values when there is no one-to-one correspondence. Weighting table can be provided
geo_aggregate( original_data, values_col, original_geo, new_geo, grouping_col = NULL, year, proportions_manual = NULL )
geo_aggregate( original_data, values_col, original_geo, new_geo, grouping_col = NULL, year, proportions_manual = NULL )
original_data |
A data frame of original data |
values_col |
The name of the column containing the values to be aggregated |
original_geo |
The name of the column containing the original geography |
new_geo |
The name of the column containing the new geography |
grouping_col |
The name of the column containing the grouping variables |
year |
The year of the data to be aggregated |
proportions_manual |
A data frame of manual proportions,it will override in-package proportions based on area. |
A data frame containing the aggregated data
Get name for a cached map
get_cache_name( year, simplification_factor, smoothing_threshold, new_crs, filter_table, aggregation )
get_cache_name( year, simplification_factor, smoothing_threshold, new_crs, filter_table, aggregation )
year |
year |
simplification_factor |
simplification_factor |
smoothing_threshold |
smoothing_threshold |
new_crs |
new_crs |
filter_table |
filter_table |
aggregation |
aggregation |
cache path
This function tibble with sf objects, for a particular year. It allows to filter the results using a geo structure names / codes, and results can be aggregated by those too. Optionally, this function stores the results in the cache for faster retrieval of large objects (e.g. when covering) a metropolitan area.
get_map( filter_table = NULL, filters = NULL, year, aggregation = NULL, simplification_factor = NULL, new_crs = NULL, fill_holes = TRUE, smoothing_threshold = 4, use_cache = FALSE, cache_file = NULL, cache_intermediates = TRUE, interstate_merge = TRUE, message_string = "" )
get_map( filter_table = NULL, filters = NULL, year, aggregation = NULL, simplification_factor = NULL, new_crs = NULL, fill_holes = TRUE, smoothing_threshold = 4, use_cache = FALSE, cache_file = NULL, cache_intermediates = TRUE, interstate_merge = TRUE, message_string = "" )
filter_table |
A data frame containing the filter table, usually the output of list_structure(). |
filters |
A list of filters to be used. Item names should name column names in list_structure(). Contents should be vectors with regular expressions. |
year |
A number indicating the year for which the map should be created. |
aggregation |
A vector containing the aggregation parameters,matching list_structure() column names . |
simplification_factor |
A number indicating the simplification factor. |
new_crs |
CRS value if transformation is needed. |
fill_holes |
whether to fill holes after merging parts |
smoothing_threshold |
A number indicating the smoothing threshold. |
use_cache |
A boolean indicating whether to use the cache. |
cache_file |
Optional a string indicating the friendly name of the cache file (f not provided, an arbitrary name will be created). |
cache_intermediates |
whether to cache state intermediate |
interstate_merge |
whether to consolidate object across state/territory lines (e.g. CED for external territories) |
message_string |
extra message string to add to any message (for tracking) |
A map object.
## Not run: small case preston <- get_map(filters=list(SSC_NAME_2016=c("Preston")), year=2016, aggregation = c("SSC_NAME_2016")) big map of Sydney,cached sydney_area <- get_map(filter_table = greater_sydney, year=2021, aggregation = "GCCSA_NAME_2021", use_cache = TRUE) ## End(Not run)
## Not run: small case preston <- get_map(filters=list(SSC_NAME_2016=c("Preston")), year=2016, aggregation = c("SSC_NAME_2016")) big map of Sydney,cached sydney_area <- get_map(filter_table = greater_sydney, year=2021, aggregation = "GCCSA_NAME_2021", use_cache = TRUE) ## End(Not run)
This function finds all the available geographic structures dataframe with the structures for each year.
list_attributes()
list_attributes()
Get list of all geographic structures (or attributes)
A tibble with the attributes for each year.
## Not run: list_attributes() ## End(Not run)
## Not run: list_attributes() ## End(Not run)
Get list elements to attribute mapping, with area proportion
list_proportions(attribute_name, ids = NULL)
list_proportions(attribute_name, ids = NULL)
attribute_name |
attribute name |
ids |
ids |
tibble with structure
produce table with geo structure
list_structure(year, filters = NULL)
list_structure(year, filters = NULL)
year |
A character string of the year for which the structure is requested. |
filters |
A list with the attributes and values of the filters to be applied (e.g. list("CED_NAME_2021"=c("Wills","Melbourne"))) |
A data frame with the structure requested.
## Not run: list_structure("2021") list_structure("2021", list("CED_NAME_2021"=c("Wills","Melbourne")) ## End(Not run)
## Not run: list_structure("2021") list_structure("2021", list("CED_NAME_2021"=c("Wills","Melbourne")) ## End(Not run)