[R] [R-sig-Geo] spatstat questions

Roger Bivand Roger.Bivand at nhh.no
Sun Dec 9 19:17:04 CET 2007

On Sun, 9 Dec 2007, Milton Cezar Ribeiro wrote:

> Hi all,
> Is there a mailing list for spatstat R package?

The website is http://www.spatstat.org (seems to be down for me, but 
that's probably me); the maintainers also read this list.

> Another question: Can I find some ebooks on Spatial Pattern Analysis to 
> be downloaded?
> Finally, how can I use a shapefile as "mask" on spatstat? I read the 
> polygon using maptools::read.shape function and now I would like to use 
> this shape as mask to define the boundary of my point pattern data.

Don't use read.shape(), it returns a raw object that is difficult to 
handle. An example with readShapePoly:

xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1])
.spatstat_check <- FALSE
NC <- as(as(xx, "SpatialPolygons"), "owin")
pts <- runifpoint(1000, NC)
plot(pts, pch=16, cex=0.5, add=TRUE)

The .spatstat_check is to turn off topology checking - please use only 
when necessary. In general the internal structures expect polygons not to 
touch or intersect, but the North Carolina counties do touch, so I have 
turned off the check.

There are more notes on Dylan Beaudette's site at:


Hope this helps,


> Kind regards
> Miltinho
> Brazil.

Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no

More information about the R-help mailing list