View source: R/local_clustering.R
local_clustering | R Documentation |
This function clusters hot spots spatially.
local_clustering(lon, lat, adjDist)
lon |
Numeric. A vector of longitude values. |
lat |
Numeric. A vector of latitude values. |
adjDist |
Numeric (>0). Distance tolerance. Unit is metre. |
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.
Integer. A vector of membership labels.
# 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)
local_clustering(lon, lat, 3000)
local_clustering(lon, lat, 4000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.