[R] Re: using shapefile as owin

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Tue Dec 2 11:09:00 CET 2003


> So your object does not conform at all to the structure owin() seems to 
> need, although there are ways of doing this - contributions welcome 
> (owin.polylist() for example).


Here's how to convert a list of 2-column matrices to a list of lists of 
x and y element vectors and feed it to owin:

owin.polylist = function(list2vecs){
  owin(poly=lapply(list2vecs,function(xy){list(x=xy[,1],y=xy[,2])}))
}

  But there will still be problems if the polygon directions aren't what 
spatstat expects.

Baz




More information about the R-help mailing list