spp {ads}R Documentation

Creating a spatial point pattern

Description

Function spp creates an object of class "spp", which represents a spatial point pattern observed in a finite sampling window (or study region). The ads library supports univariate, multivariate and marked point patterns observed in simple (rectangular or circular) or complex sampling windows.

Usage

spp(x, y=NULL, window, triangles, marks, int2fac=TRUE)
ppp2spp(p)

Arguments

x, y

if y=NULL, x is a list of two vectors of point coordinates, else both x and y are atomic vectors of point coordinates.

window

a "swin" object or a vector defining the limits of a simple sampling window: c(xmin,ymin,xmax,ymax) for a rectangle ; c(x0,y0,r0) for a circle.

triangles

(optional) a list of triangles removed from a simple initial window to define a complex sampling window (see swin).

marks

(optional) a vector of mark values, which may be factor levels or numerical values (see Details).

int2fac

if TRUE, integer marks are automatically coerced into factor levels.

p

a "ppp" object from package spatstat.geom.

Details

A spatial point pattern is assumed to have been observed within a specific sampling window (a finite study region) defined by the window argument. If window is a simple "swin" object, it may be coerced into a complex type by adding a triangles argument (see swin). A spatial point pattern may be of 3 different types.

Value

An object of class "spp" describing a spatial point pattern observed in a given sampling window.

$type

a character string indicating if the spatial point pattern is "univariate", "multivariate" or "marked".

$window

an swin object describing the sampling window (see swin).

$n

an integer value giving the number of points of the pattern located inside the sampling window (points on the boundary are considered to be inside).

$x

a vector of x coordinates of points located inside the sampling window.

$y

a vector of y coordinates of points located inside the sampling window.

$nout

(optional) an integer value giving the number of points of the pattern located outside the sampling window.

$xout

(optional) a vector of x coordinates of points located outside the sampling window.

$yout

(optional) a vector of y coordinates of points located outside the sampling window.

$marks

(optional) a vector of the marks attached to points located inside the sampling window.

$marksout

(optional) a vector of the marks attached to points located outside the sampling window.

Note

There are printing, summary and plotting methods for "spp" objects.
Function ppp2spp converts an ppp.object from package spatstat.geom into an "spp" object.

Author(s)

Raphael.Pelissier@ird.fr

References

Goreaud, F. and P?Pelissier, R. 1999. On explicit formula of edge effect correction for Ripley's K-function. Journal of Vegetation Science, 10:433-438.

See Also

plot.spp, swin

Examples

	data(BPoirier)
	BP <- BPoirier
	## Not run: univariate pattern in a rectangle of size [0,110] x [0,90]
	swr <- spp(BP$trees, win=BP$rect)
	## Not run: an alternative using atomic vectors of point coordinates
	swr <- spp(BP$trees, win=BP$rect) 
	summary(swr)
	plot(swr)
	
	## Not run: univariate pattern in a circle with radius 50 centred on (55,45)
	swc <- spp(BP$trees, win=c(55,45,50))
	summary(swc)
	plot(swc)
	plot(swc, out=TRUE) # plot points outside the circle

	## Not run: multivariate pattern in a rectangle of size [0,110] x [0,90]
	swrm <- spp(BP$trees, win=BP$rect, marks=BP$species)
	summary(swrm)
	plot(swrm)
	plot(swrm, chars=c("b","h","o")) # replace symbols by letters
	
	## Not run: marked pattern in a rectangle of size [0,110] x [0,90]
	swrn <- spp(BP$trees, win=BP$rect, marks=BP$dbh)
	summary(swrn)
	plot(swrn)
	
	## Not run: multivariate pattern in a complex sampling window
	swrt <- spp(BP$trees, win=BP$rect, tri=BP$tri1, marks=BP$species)
	summary(swrt)
	plot(swrt)
	plot(swrt, out=TRUE) # plot points outside the sampling window
	
	
	## Not run: converting a ppp object from spatstat.geom
	data(demopat)
	demo.spp<-ppp2spp(demopat)
	plot(demo.spp)

[Package ads version 1.5-10 Index]