Learn R Programming

animalEKF (version 1.3)

tess2spat: Convert Voronoi tessellation tiles to a shapefile.

Description

Convert Voronoi tessellation tiles to a shapefile.

Usage

tess2spat(obj, idvec=NULL)

Value

Object of class SpatialPolygons.

Arguments

obj

Voronoi tessellation object created through function deldir.

idvec

Optional vector of ids for output shapefile polygons.

Author

Samuel Ackerman

Examples

Run this code

library(deldir)
library(sp)

vortess <- deldir(x=runif(8), y=runif(8), plotit=FALSE, suppressMsge=TRUE)
old_pars <- par(mfcol=par()$mfcol)

par(mfcol=c(1,2))
deldir::plot.deldir(vortess, wlines="tess", xlim=c(0,1), ylim=c(0,1))
vortess_shape <- tess2spat(obj=vortess)
plot(vortess_shape)
par(old_pars)

Run the code above in your browser using DataLab