# clusterset

##### Allard-Fraley Estimator of Cluster Feature

Detect high-density features in a spatial point pattern using the (unrestricted) Allard-Fraley estimator.

##### Usage

```
clusterset(X, result=c("marks", "domain"),
..., verbose=TRUE,
fast=FALSE,
exact=!fast && spatstat.options("gpclib"))
```

##### Arguments

- X
- A dimensional spatial point pattern (object of class
`"ppp"`

). - result
- Character string specifying the type of result. See Details.
- verbose
- Logical value indicating whether to print progress reports.
- fast
- Logical. If
`FALSE`

(the default), the Dirichlet tile areas will be computed exactly using polygonal geometry, so that the optimal choice of tiles will be computed exactly. If`TRUE`

, the Dirichlet tile areas will be - exact
- Logical. If
`TRUE`

, the Allard-Fraley estimator of the domain will be computed exactly using polygonal geometry. If`FALSE`

, the Allard-Fraley estimator of the domain will be approximated by a binary pixel mask. The d - ...
- Optional arguments passed to
`as.mask`

to control the pixel resolution if`exact=FALSE`

.

##### Details

Allard and Fraley (1997) developed a technique for recognising features of high density in a spatial point pattern in the presence of random clutter.

This algorithm computes the *unrestricted* Allard-Fraley estimator.
The Dirichlet (Voronoi) tessellation of the point pattern `X`

is
computed. The smallest `m`

Dirichlet cells are selected,
where the number `m`

is determined by a maximum likelihood
criterion.

- If
`fast=FALSE`

(the default), the areas of the tiles of the Dirichlet tessellation will be computed exactly using polygonal geometry. This ensures that the optimal selection of tiles is computed exactly. - If
`fast=TRUE`

, the Dirichlet tile areas will be approximated by counting pixels. This is faster, and is usually correct (depending on the pixel resolution, which is controlled by the arguments`...`

).

If `result="marks"`

the result is the point pattern `X`

with a vector of marks labelling each point with a value `yes`

or
`no`

depending on whether the corresponding Dirichlet cell is
selected by the Allard-Fraley estimator. In other words each point of
`X`

is labelled as either a cluster point or a non-cluster point.

If `result="domain"`

, the result is the Allard-Fraley estimator
of the cluster feature set, which is the union of all the
selected Dirichlet cells, represented as a window (object of class
`"owin"`

).

- If
`exact=TRUE`

, the Allard-Fraley set estimator will be computed exactly using polygonal geometry. This requires the packagegpclib which has a restricted licence: see`licence.polygons`

. The result is a polygonal window. - If
`exact=FALSE`

, the Allard-Fraley set estimator will be approximated by a binary pixel mask. This is much faster than the exact computation. The result is a binary mask.

`exact=FALSE`

.
##### Value

- If
`result="marks"`

, a multitype point pattern (object of class`"ppp"`

).If

`result="domain"`

, a window (object of class`"owin"`

).

##### References

Allard, D. and Fraley, C. (1997)
Nonparametric maximum likelihood estimation of features in
spatial point processes using Voronoi tessellation.
*Journal of the American Statistical Association*
**92**, 1485--1493.

##### See Also

##### Examples

```
opa <- par(mfrow=c(1,2))
W <- grow.rectangle(as.rectangle(letterR), 1)
X <- superimpose(runifpoint(300, letterR),
runifpoint(50, W), W=W)
plot(W, main="clusterset(X)")
plot(clusterset(X, fast=TRUE), add=TRUE, chars=c("o", "+"), cols=1:2)
plot(letterR, add=TRUE)
plot(W, main="clusterset(X, 'd')")
plot(clusterset(X, "d", exact=FALSE), add=TRUE)
plot(letterR, add=TRUE)
par(opa)
```

*Documentation reproduced from package spatstat, version 1.31-3, License: GPL (>= 2)*