rsMove (version 0.2.1)

hotMove: hotMove

Description

Identifies hotspots of samples using a pixel based approach.

Usage

hotMove(xy = xy, pxr = pxr, shp = FALSE)

Arguments

xy

Object of class SpatialPoints of SpatialPointsDataFrame.

pxr

Grid resolution. Unit depends on xy projection.

shp

Logical. Should the function provide polygons? Default is FALSE.

Value

A list object.

Details

The function builds a matrix for a given resolution and a spatial extent derived from a set of samples (xy). First, these samples are converted into unique pixel coordinates. Then, the spatial connectivity of these pixels is evaluated using a 8-neighboor connected component labelling algorithm. The function returns a vector with the region ID per sample ($indices). If shp is TRUE the function also returns a shapefile for each region defined by the convex hull of the samples within them ($polygons).

See Also

sampleMove hotMoveStats

Examples

Run this code
# NOT RUN {
{

require(raster)

# reference data
sprj <- crs("+proj=longlat +ellps=WGS84 +no_defs")
moveData <- read.csv(system.file('extdata', 'latlon_example.csv', package="rsMove"))
moveData <- SpatialPointsDataFrame(moveData[,2:3], moveData, proj4string=sprj)

# extract regions
hm <- hotMove(xy=moveData, pxr=0.1, shp=TRUE)

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

# add new information to original shapefile
moveData@data$indices <- hm$indices

}
# }

Run the code above in your browser using DataLab