top_clusters {scanstatistics} | R Documentation |
Get the top (non-overlappig) clusters.
Description
Get the top k
space-time clusters according to the statistic calculated
for each cluster (the maximum being the scan statistic). The default is to
return the spatially non-overlapping clusters, i.e. those that do not have
any locations in common.
Usage
top_clusters(
x,
zones,
k = 5,
overlapping = FALSE,
gumbel = FALSE,
alpha = NULL,
...
)
Arguments
x |
An object of class scanstatistics. |
zones |
A list of integer vectors. |
k |
An integer, the number of clusters to return. |
overlapping |
Logical; should the top clusters be allowed to overlap in
the spatial dimension? The default is |
gumbel |
Logical; should a Gumbel P-value be calculated? The default is
|
alpha |
A significance level, which if not |
... |
Parameters passed to |
Value
A data frame with at most k
rows, with columns
zone, duration, score
and possibly MC_pvalue, Gumbel_pvalue
and critical_value
.
Examples
set.seed(1)
counts <- matrix(rpois(15, 3), 3, 5)
zones <- list(1:2, 1:3, 2:5, c(1, 3), 4:5, c(1, 5))
scanres <- scan_permutation(counts, zones, n_mcsim = 5)
top_clusters(scanres, zones, k = 4, overlapping = FALSE)