ibra_region: Identify IBRA 7 regions or subregions

Description Usage Arguments Value See Also Examples

Description

Return the names of the set of IBRA regions or subregions within which a set of points falls.

Usage

1
ibra_region(pts, tabulate = TRUE, min_n = 1, type = "subregion")

Arguments

pts

A SpatialPolygons* object.

tabulate

Logical. If TRUE, return a named vector indicating the number of points in each occupied region.

min_n

The minimum number of points a region must contain in order for the region name to be returned when tabulate is FALSE.

type

Character. Either 'region' or 'subregion'. This determines how the IBRA polygons will be subset: 'region' results in subregion polygons bing returned even if they contain no points, as long as other subregions of that region contain a total of at least min_n points; subregion returns only the subregion polygons that contain at least min_n points.

Value

If tabulate is FALSE, a vector of IBRA 7 subregion (or region, see type) names corresponding to the IBRA 7 regions (or subregions) that at least min_n pts fall within. If tabulate is TRUE, a named vector showing the number of points in each occupied IBRA 7 subregions (or regions). Points that do not overlie an IBRA 7 subregion will be ignored with a warning.

See Also

adjacent_ibra

Examples

1
2
3
4
5
6
7
library(sp)
xy <- SpatialPoints(data.frame(x=runif(1000, 140, 145), y=runif(1000, -38, -35)))
proj4string(xy) <- '+init=epsg:4283'
reg <- ibra_region(xy, type='region')
reg
subreg <- ibra_region(xy, type='subregion')
subreg

johnbaums/things documentation built on May 19, 2019, 3:03 p.m.