View source: R/merge_clusters.R
merge_clusters | R Documentation |
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
)
df |
a data frame created by |
dt_field |
POSIXct; name of datetime field. |
radius |
numeric; distance threshold (meters) used to aggregate clusters. |
minPts |
numeric; minimum number of points points required in each cluster. |
borderPoints |
logical; should border points be assigned to clusters. Default = TRUE. If FALSE, border points are considered noise. |
keep_noise |
logical; should noise points be retained? Default = FALSE. |
noise_threshold |
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 |
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.
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
.
## Not run:
merge_clusters(
df, dt_field = NULL, radius = 100, minPts = 5, borderPoints = TRUE,
keep_noise = FALSE, noise_threshold = 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.