Skip to contents

This function clusters hot spots spatially.

Usage

local_clustering(lon, lat, adjDist)

Arguments

lon

Numeric. A vector of longitude values.

lat

Numeric. A vector of latitude values.

adjDist

Numeric (>0). Distance tolerance. Unit is metre.

Value

Integer. A vector of membership labels.

Details

For more details about the clustering algorithm and the argument adjDist, please check the documentation of hotspot_cluster(). This function performs the step 2 of the clustering algorithm. It clusters hot spots in a given interval.

Examples


# Define lon and lat 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)

# Cluster 10 hot spots with different values of adjDist
local_clustering(lon, lat, 2000)
#>  [1] 1 2 3 3 3 4 4 4 5 5
local_clustering(lon, lat, 3000)
#>  [1] 1 1 1 1 1 1 1 1 1 1
local_clustering(lon, lat, 4000)
#>  [1] 1 1 1 1 1 1 1 1 1 1