Skip to content

(no subject)

4 messages · Adrian Baddeley, Roger Bivand, Michael Friendly

#
On Tue, 13 Mar 2007, Michael Friendly wrote:

            
To create a circular window in spatstat, you can use the 
function disc(). See help(disc). 

For example suppose a point pattern with coordinates x, y (two vectors)
is observed inside a pot with centre (x0, y0) and radius R.
Then 
	   pot <- disc(R, c(x0,y0))
creates a window (owin object) representing the pot,
and
	   X <- ppp(x, y, window=pot)
creates the point pattern. 

Since spatstat always plots spatial objects isometrically, you can also 
use plot(disc(....)) just to draw a circle.
Currently, a point pattern can only have one mark variable
(e.g. you can attach the SeedType to each point, or attach the size to
each point, but not both).
This will change in spatstat version 2 which will be released soon.
There is nothing better than spatstat!  %^]

regards
Adrian Baddeley
#
On Thu, 15 Mar 2007, Adrian Baddeley wrote:

            
Great!

To get to the sp Polygon object:

res0 <- disc(1, c(0,0))$bdry
res <- Polygon(rbind(res0, res0[1,]))

should anyone need it.

Roger

  
    
#
On Thu, 15 Mar 2007, Roger Bivand wrote:

            
Should be:

res0 <- coordinates(disc(1, c(0,0))$bdry)
res <- Polygon(rbind(res0, res0[1,]))

to turn the list into a matrix, sorry.

Roger

  
    
#
Thanks very much, Adrian.

-Michael
Adrian Baddeley wrote: