stacel
Search-circle hot-spot areas
stacel( x, y = NULL, win, nx = 20, ny = 20, r, top = 25, minpts = 5, k = 1, c = 1, count = NULL)Hot-spot areas from search circles (Block and Block 1995): circles of
radius r are centred on the nodes of an nx by ny grid spanning the
rectangle win (corners included), the points in each are counted, the
circles holding at least two points are ranked by count and the first
top are kept; kept circles that share a point are merged, repeatedly,
and a hot-spot area is the set of points in a merged group, kept if it
has at least minpts. Descriptions differ on the circle’s radius and on
the grid; both are the caller’s choice here.
Parameters
Section titled “Parameters”x, yThe points in planar coordinates (project longitude and latitude with
eqproj()first):xandynumeric vectors of equal length, orxa matrix or data frame with columns namedxandy(an unnamed two-column matrix is read asxtheny). At least two points, all insidewin; no missing values.winThe rectangle the grid spans,
c(xmin, xmax, ymin, ymax); points may lie outside it.nx, nyThe numbers of grid nodes across and up: whole numbers from 2 to 10000.
rThe search radius, positive, in the unit of the coordinates.
topThe number of busiest circles kept: one whole number from 1.
minptsThe fewest points a hot-spot area keeps: a whole number from 2.
kThe divisor offset: 0, 1 or 2; the total weight must exceed it.
cThe multiplier of each cluster’s standard deviational ellipse (see
sdell()).countNULLfor points, or for zones: one whole count from 0 per zone, the pointsx,ybeing the zones’ centroids. A zone is taken ascountincidents at its centroid, which these hot-spot rules treat exactly as coincident points. Zones with count 0 getNA; the random-expectation threshold counts incidents, not zones.
Returns
Section titled “Returns”A list. cl, the hot-spot area of each point (zone) (a row of
clusters) or NA, in input order. clusters, a data frame with one
row per area, by size: points, mx, my (mean centre), wx, wy
(centre of minimum distance), a, b and angle (the standard
deviational ellipse of its points).
References
Section titled “References”Block, R. L. and Block, C. R. (1995). Space, place and crime: hot spot areas and hot places of liquor-related crime. In J. E. Eck and D. Weisburd (eds.), Crime and Place, Crime Prevention Studies 4, 145-183. Criminal Justice Press.
Examples
Section titled “Examples”set.seed(1)x <- c(rnorm(30, 2, 0.2), runif(60, 0, 10))y <- c(rnorm(30, 2, 0.2), runif(60, 0, 10))stacel(x, y, win = c(0, 10, 0, 10), r = 0.75, top = 5, minpts = 5)$clustersGenerated from the R help page: stacel in the R reference.