View source: R/global_clustering.R
global_clustering | R Documentation |
This function clusters hot spots spatially and temporally.
global_clustering(lon, lat, timeID, activeTime, adjDist)
lon |
Numeric. A vector of longitude values. |
lat |
Numeric. A vector of latitude values. |
timeID |
Integer (>=1). A vector of time indexes. |
activeTime |
Numeric (>=0). Time tolerance. Unit is time index. |
adjDist |
Numeric (>0). Distance tolerance. Unit is metre. |
For more details about the clustering algorithm and the arguments
activeTime
and adjDist
, please check the documentation
of hotspot_cluster()
.
This function performs the first 3 steps of the clustering algorithm.
Integer. A vector of membership labels.
# Define lon, lat and timeID for 10 observations
lon <- c(141.1, 141.14, 141.12, 141.14, 141.16, 141.12, 141.14,
141.16, 141.12, 141.14)
lat <- c(-37.10, -37.10, -37.12, -37.12, -37.12, -37.14, -37.14,
-37.14, -37.16, -37.16)
timeID <- c(rep(1, 5), rep(26, 5))
# Cluster 10 hot spots with different values of activeTime and adjDist
global_clustering(lon, lat, timeID, 12, 1500)
global_clustering(lon, lat, timeID, 24, 3000)
global_clustering(lon, lat, timeID, 36, 6000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.