Detection of geographic regions of samples using a pixel based approach.
Usage
hotMove(x, y, return.shp = FALSE)
Arguments
x
Object of class SpatialPoints of SpatialPointsDataFrame.
y
Grid resolution. Unit depends on x projection.
return.shp
Logical. Should the function return polygons of the regions? Default is FALSE.
Value
A List containing a vector of region ID's per data point ($indices) and region polygons ($polygons).
Details
First, the function builds a raster with a resolution equal to y and the
spatial extent of x. Then, each point in x is converted into pixel coordinates.
Based on the unique pixel coordinates, the function then evaluates the spatial connectivity of
these pixels using a 8-neighbor connected component labeling algorithm to detect regions. Finally,
the ID's are related back to each individual data point in x based on their pixel coordinates
and - if return.shp is TRUE - a polygon is derived from the convex hull of the points within
each region. The output of the function consists of:
region.id - Vector reporting on the region each element in x belongs to.
polygons - Polygons for each unique region in region.id specified by the data column region.
plot - A plot with the output of polygons accessible if return.shp is TRUE.