merge_clusters.Rd
merge_clusters()
aggregates spatiotemporal clusters within a specified distance using the
Density-based Spatial Clustering of Applications with Noise (DBSCAN
) algorithm.
After merging, the remaining clusters are not temporally unique.
merge_clusters(
df,
dt_field = NULL,
radius = 100,
minPts = 5,
borderPoints = TRUE,
keep_noise = FALSE,
noise_threshold = 1
)
a data frame created by circleclust()
with a sp_temporal_cluster
column and datetime column.
POSIXct; name of datetime field.
numeric; distance threshold (meters) used to aggregate clusters.
numeric; minimum number of points points required in each cluster.
logical; should border points be assigned to clusters. Default = TRUE. If FALSE, border points are considered noise.
logical; should noise points be retained? Default = FALSE.
numeric; threshold value (%) to determine if noise points should be retained.
If the percentage of noise points is above this value, noise points are retained and column noise
is
appended to the output data frame. Noise points are deleted otherwise. This argument is ignored if
'keep_noise' is set to FALSE.
a data frame. The original spatiotemporal cluster values are retained
in a column called sp_temporal_cluster
. New spatially merged cluster values are
listed under spatial_cluster
.
merge_clusters()
spatially combines clusters based on the Euclidean distance between points. Because the Earth is sphere, the calculated
distances are not exact. See here.
if (FALSE) {
merge_clusters(
df, dt_field = NULL, radius = 100, minPts = 5, borderPoints = TRUE,
keep_noise = FALSE, noise_threshold = 1)
}