global_clustering: Clustering hot spots spatially and temporally

View source: R/global_clustering.R

global_clusteringR Documentation

Clustering hot spots spatially and temporally

Description

This function clusters hot spots spatially and temporally.

Usage

global_clustering(lon, lat, timeID, activeTime, adjDist)

Arguments

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.

Details

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.

Value

Integer. A vector of membership labels.

Examples


# 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)


spotoroo documentation built on Aug. 21, 2023, 9:10 a.m.