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

Description Usage Arguments Methods Author(s) Examples

View source: R/spatstat1.R

Description

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

Usage

1

Arguments

x

spatstat object of class tess to coerce from

Methods

coerce

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

Author(s)

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

Examples

1
2
3
4
5
6
7
8
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)
}

Example output

Loading required package: sp
Checking rgeos availability: TRUE
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package calledspatstat.geom

maptools documentation built on Sept. 7, 2021, 5:09 p.m.