voronoiHulll: Voronoi hull model

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Voronoi polygons for presence/absence data

Usage

1
2
3
4
5
6
## S4 method for signature 'matrix,matrix'
voronoiHull(p, a, ext=NULL, dissolve=FALSE, crs=NA, ...)
## S4 method for signature 'data.frame,data.frame'
voronoiHull(p, a, ext=NULL, dissolve=FALSE, crs=NA, ...)
## S4 method for signature 'SpatialPoints,SpatialPoints'
voronoiHull(p, a, ext=NULL, dissolve=FALSE, ...)

Arguments

p

Presence points. Two column matrix, data.frame, or a SpatialPoints* object

a

Absence points. Must be of the same class as p

ext

Extent to limit or expand the area of interest

dissolve

Boolean. Dissolve (aggregate) polygons?

crs

character or CRS object. PROJ.4 notation coordinate reference system

...

Additional arguments passed to voronoi

Value

A VoronoiHull object (inherits from DistModel-class)

Note

This function is only correct when using a planar coordinate reference system (not longitude/latitude).

Author(s)

Robert J. Hijmans

See Also

convHull, voronoi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
r <- raster(system.file("external/rlogo.grd", package="raster"))
# presence points
p <- matrix(c(17, 42, 85, 70, 19, 53, 26, 84, 84, 46, 48, 85, 4, 95, 48, 54, 66, 74, 50, 48, 
      28, 73, 38, 56, 43, 29, 63, 22, 46, 45, 7, 60, 46, 34, 14, 51, 70, 31, 39, 26), ncol=2)

# absence points
a <- matrix(c(30, 23, 5, 5, 31, 33, 91, 63, 60, 88, 93, 97, 65, 68, 85, 97, 35, 32, 29, 55,
      3, 8, 19, 71, 49, 36, 69, 41, 20, 28, 18, 9, 5, 9, 25, 71, 8, 32, 46, 60), ncol=2)

v <- voronoiHull(p, a)
	  
x <- predict(r, v)

## Not run: 
plot(x)
points(p, col='black', pch=20, cex=2)
points(a, col='red', pch=20, cex=2)

## End(Not run)

Example output

Loading required package: raster
Loading required package: sp
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
Loading required namespace: deldir
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

dismo documentation built on May 2, 2019, 6:07 p.m.