Learn R Programming

rsMove (version 0.2.4)

hotMove: hotMove

Description

Detection of geographic regions of samples using a pixel based approach.

Usage

hotMove(xy, pixel.res, return.shp = FALSE)

Arguments

xy

Object of class SpatialPoints of SpatialPointsDataFrame.

pixel.res

Grid resolution. Unit depends on xy projection.

return.shp

Logical. Should the function return polygons of the regions? Default is FALSE.

Value

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 pixel.res and the spatial extent of xy. Then, each point in xy 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 xy 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.

See Also

sampleMove hotMoveStats

Examples

Run this code
# NOT RUN {
{

require(raster)

# reference data
data(longMove)

# extract regions
hm <- hotMove(longMove, 0.1, return.shp=TRUE)

# plot shapefile (color by region)
plot(hm$polygons, col=hm$indices)

}
# }

Run the code above in your browser using DataLab