Description Usage Arguments Details Value See Also Examples
Detection of geographic regions of samples using a pixel based approach.
1 |
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. |
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.
A List containing a vector of region ID's per data point ($indices) and region polygons ($polygons).
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.