Learn R Programming

maptools (version 1.1-6)

as.SpatialPolygons.tess: Coercion of spatstat tess object to sp SpatialPolygons object

Description

This function coerces spatstats tessellation objects of class tess to sps SpatialPolygons class. S4-style as() coercion works as well.

Usage

as.SpatialPolygons.tess(x)

Methods

coerce

signature(from = "tess", to = "SpatialPolygons")

Arguments

x

spatstat object of class tess to coerce from

Author

Edzer Pebesma edzer.pebesma@uni-muenster.de, Roger Bivand

Examples

Run this code
run <- FALSE
if (require("spatstat.geom", quietly=TRUE)) run <- TRUE
if (run) {
A <- tess(xgrid=0:4,ygrid=0:4)
A_sp <- as(A, "SpatialPolygons")
plot(A_sp)
text(coordinates(A_sp), labels=row.names(A_sp), cex=0.6)
}

Run the code above in your browser using DataLab