R/datadocs.R

# Shapefiles ------------------------------------------------------------------

#' Pre-processed Shapefiles
#'
#' Four "SpatialPolygonsDataFrame" objects, describing both Local Government
#' Areas (LGAs) and postcode boundaries (POAs) in both the resolution at which
#' the Australian Bureau of Statistics provides them and in a simplified form
#' (substantially smaller size-wise and thus better for performance when
#' rendering them on a map).
#'
#' \itemize{
#'     \item The Big___ SPDFs were imported using the "rgdal" package. Inspect
#'         the \code{\link{ReadOzShapefile}} function for details.
#'     \item The Simple___ SPDFs use rmapshaper to intelligently simplify the
#'         Big___ SPDFs. This is important for object size and performance when
#'         rendering in e.g. plotly, ggplot2 or leaflet. Inspect the
#'         \code{\link{SimplifyOzShapefile}} function for details.
#' }
#'
#' @name OzShapefiles
#'
#' @format A SpatialPolygonsDataFrame (see "sp" or other packages):
#' \describe{
#'     \item{BigLGA}{545 high-resolution Local Government Area polygons.}
#'     \item{SimpleLGA}{545 simplified Local Government Area polygons.}
#'     \item{BigPOA}{2668 high-resolution postcode boundary polygons.}
#'     \item{SimplePOA}{2668 simplified postcode boundary polygons.}
#' }
#'
#' @source \url{https://www.abs.gov.au/ausstats/abs@.nsf/mf/1270.0.55.003}
NULL

#' @rdname OzShapefiles
"BigLGA"

#' @rdname OzShapefiles
"BigPOA"

#' @rdname OzShapefiles
"SimpleLGA"

#' @rdname OzShapefiles
"SimplePOA"

# Centroids -------------------------------------------------------------------

#' Centres of LGA/POA Polygons
#'
#' Tibbles (or data frames) containing (long, lat) pairs describing the
#' "centroids" of the LGA and POA polygons included in this package.
#' These are calculated using the high-resolution SpatialPolygonsDataFrames,
#' using the coordinates() function from the "raster" package.
#'
#' @name OzCentroids
#'
#' @format Tibbles with one row per polygon and 3 variables:
#' \describe{
#'     \item{long}{Longitudinal coordinate of centroid}
#'     \item{lat}{Latitudinal coordinate of centroid}
#'     \item{Name}{Name of polygon (i.e. name of LGA or POA)}
#' }
NULL

#' @rdname OzCentroids
"CentroidsPOA"

#' @rdname OzCentroids
"CentroidsLGA"

# Intersections ---------------------------------------------------------------

#' Intersection Matrix
#'
#' A large matrix containing the area intersections of each LGA and POA in
#' km^2. The benefit of doing this with absolute area in km^2 is that this is
#' then bi-directional - rather than two matrices for the percent of each LGA
#' contained in each POA and vice versa, one can use the AREASQKM16 field that
#' comes with the ABS shapefiles to calculate the percentage overlap either
#' way.
#'
#' @format Matrix with 545 rows and 2668 columns:
#' \describe{
#'     \item{rownames}{545 Local Government Area names}
#'     \item{colnames}{2668 postcode names}
#' }
"IntersectionMatrix"

# State Dict ------------------------------------------------------------------

#' State Subregion Dictionary
#'
#' A list of two associate lists connecting states to their LGAs and POAs.
#'
#' @format List of two lists:
#' \describe{
#'     \item{$LGAs}{8 lists (named with state abbreviations) of LGA names.}
#'     \item{$POAs}{8 lists (named with state abbreviations) of POA codes.}
#' }
"StateSubregionDict"
mjkerrison/OzMap documentation built on Dec. 27, 2019, 2:18 a.m.