gpc2owin {spatstat} | R Documentation |
Conversion between the different representations of a polygonal region in the packages spatstat and gpclib.
gpc2owin(x) owin2gpc(x)
x |
Object representing a polygonal region.
An object of class |
The packages spatstat and gpclib have slightly different
internal formats for representing a polygonal region in the
two-dimensional plane. In gpclib a polygonal region is
an object of class "gpc.poly"
, while in spatstat
it is an object of class "owin"
and of type "polygonal"
.
These two functions convert the two formats: owin2gpc
converts
an "owin"
to a "gpc.poly"
, while gpc2owin
does the reverse.
Conversion of a "gpc.poly"
to an "owin"
can also be
performed by calling as.owin
.
An object of class "owin"
in the spatstat
package (for gpc2owin
) or an object of class
"gpc.poly"
in the gpclib package (for owin2gpc
).
Adrian Baddeley Adrian.Baddeley@csiro.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
data(letterR) if(spatstat.options("gpclib") && require(gpclib)) { R <- owin2gpc(letterR) L <- gpc2owin(R) } else cat("gpclib is not available\n")