
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.spp(x, y=NULL, window, triangles, marks, int2fac=TRUE)
y=NULL
, $x$ is a list of two vectors of point coordinates, else both $x$ and $y$ are atomic vectors of point coordinates."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.swin
)."spp"
describing a spatial point pattern observed in a given sampling window.$type
"univariate"
, "multivariate"
or "marked"
.$window
swin
object describing the sampling window (see swin
).$n
$x
$y
$nout
$xout
$yout
$marks
$marksout
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.
marks
is not given.marks
is a factor, which levels are interpreted as categorical marks (e.g. colours, species, etc.) attached to points of the pattern.
Integer marks may be automatically coerced into factor levels when argumentint2fac = TRUE
.marks
is a vector of real numbers attached to points of the pattern. Integer values may also be considered as numerical values
if argumentint2fac = FALSE
.plot.spp
,
swin
data(BPoirier)
BP <- BPoirier
# univariate pattern in a rectangle of size [0,110] x [0,90]
swr <- spp(BP$trees, win=BP$rect)
# an alternative using atomic vectors of point coordinates
#swr <- spp(BP$trees, win=BP$rect)
summary(swr)
plot(swr)
# 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
# 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
# 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)
# 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
#converting a ppp object from spatstat
data(demopat)
demo.spp<-ppp2spp(demopat)
plot(demo.spp)
Run the code above in your browser using DataLab